We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description:
int batchSize = 70; ..... sql:ParameterizedQuery sqlQuery = `SELECT TOP ${batchSize} guid , date FROM MigrationRecords`
This gives an error as follows.
Incorrect syntax near '@P0'.. {"errorCode":102,"sqlState":"S0001"}
When the batchSize is hard coded in the query, this works fine. If the variable is in where clause, it doesn't give any error and picks up the value.
Steps to reproduce:
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered:
Workaround: Use OFFSET 0 ROWS FETCH FIRST ${batchSize} ROWS ONLY; instead of TOP ${batchSize}
OFFSET 0 ROWS FETCH FIRST ${batchSize} ROWS ONLY;
TOP ${batchSize}
Sorry, something went wrong.
This is the expected behaviour as top clause value cannot be parameterized i.e it cannot be a user insertions at runtime.
Database expects the top clause value at compile time and this needs to be available in the query.
kaneeldias
niveathika
No branches or pull requests
Description:
This gives an error as follows.
Incorrect syntax near '@P0'.. {"errorCode":102,"sqlState":"S0001"}
When the batchSize is hard coded in the query, this works fine. If the variable is in where clause, it doesn't give any error and picks up the value.
Steps to reproduce:
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: