Skip to content
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

Let SQL Server top statement use parenthesis #2710

Merged
merged 2 commits into from May 31, 2023

Conversation

loicprieur
Copy link
Contributor

@loicprieur loicprieur commented Mar 1, 2023

Fixes #2709

Problem

Queries with .take against SQL Server were failing with:

com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '@P0'

Solution

Wrap the TOP (parameter) in parenthesis as recommended by MSFT:

https://learn.microsoft.com/en-us/sql/t-sql/queries/top-transact-sql?view=sql-server-ver16#compatibility-support

Notes

Additional notes.

Checklist

  • Unit test all changes
  • Update README.md if applicable
  • Add [WIP] to the pull request title if it's work in progress
  • Squash commits that aren't meaningful changes
  • Run sbt scalariformFormat test:scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

@CLAassistant
Copy link

CLAassistant commented Mar 1, 2023

CLA assistant check
All committers have signed the CLA.

@loicprieur loicprieur changed the title Fix zio/zio-quill#2709: SQL Server top statement doesn't use parenthesis Let SQL Server top statement use parenthesis Mar 1, 2023
Copy link
Collaborator

@juliano juliano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@juliano juliano merged commit 50294f4 into zio:master May 31, 2023
18 checks passed
joelsonoda pushed a commit to joelsonoda/zio-quill that referenced this pull request Jun 27, 2023
…2710)

Co-authored-by: Juliano Alves <von.juliano@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQLServerDialect does not wrap TOP statement in parenthesis
3 participants