MS SQL Exception: Incorrect syntax near '@P0'

前端 未结 7 658
孤街浪徒
孤街浪徒 2020-12-03 16:36

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

7条回答
  •  感动是毒
    2020-12-03 17:09

    SQL Server requires you to place parenthesis around the argument to top if you pass in a variable:

    SELECT TOP (?)
    

提交回复
热议问题