-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLServerDialect does not wrap TOP statement in parenthesis #2709
Comments
loicprieur
pushed a commit
to loicprieur/zio-quill
that referenced
this issue
Mar 1, 2023
5 tasks
loicprieur
pushed a commit
to loicprieur/zio-quill
that referenced
this issue
Mar 1, 2023
loicprieur
added a commit
to loicprieur/zio-quill
that referenced
this issue
Mar 1, 2023
juliano
added a commit
that referenced
this issue
May 31, 2023
joelsonoda
pushed a commit
to joelsonoda/zio-quill
that referenced
this issue
Jun 27, 2023
jilen
pushed a commit
that referenced
this issue
Jun 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
.take(x)
with a runtime value on MS SQL Server causes the query to fail.Moreover parenthesis are recommended by Microsoft: https://learn.microsoft.com/en-us/sql/t-sql/queries/top-transact-sql?view=sql-server-ver16#compatibility-support
Version:
4.6.0
Module:
quill-jdbc
/quill-engine
(not sure)Database:
mssqlserver
Expected behavior
Expected query to succeed and keep only the first x results (where x is
take
's parameter).Actual behavior
query fails with:
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '@P0'
Steps to reproduce the behavior
Workaround
2 options:
drop
andtake
which makes the dialect use the OFFSET FETCH syntax, which in turn requires the query to be sorted, and indexed.@getquill/maintainers
The text was updated successfully, but these errors were encountered: