I\'m querying a DB using MS SQL and for some reason I get the following error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near \'@P0\' ev
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near \'@P0\'
SQL Server requires you to place parenthesis around the argument to top if you pass in a variable:
top
SELECT TOP (?)