This commit is contained in:
dataeaseShu
2025-07-25 11:04:27 +08:00
+2 -3
View File
@@ -292,10 +292,9 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table
{where}
LIMIT 100"""
elif ds.type == "sqlServer":
sql = f"""SELECT [{"], [".join(fields)}] FROM [{conf.dbSchema}].[{data.table.table_name}]
sql = f"""SELECT TOP 100 [{"], [".join(fields)}] FROM [{conf.dbSchema}].[{data.table.table_name}]
{where}
ORDER BY [{fields[0]}]
OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY"""
"""
elif ds.type == "pg" or ds.type == "excel":
sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}"
{where}