简体   繁体   中英

SQL query is throwing this error Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '

Query is :

select * from Test.dbo.Test_Spoc where spocNo = 54986 

In SQL 2008 its throwing error Incorrect syntax near ' '. IF I remove the space before Where and again give the space its working. In SQL 2012 this query is showing red sign also before Where that problem is in this space.

I want to know what can be reason that earlier space is not working?

select * from Test.dbo.Test_Spoc where spocNo = '54986'

Add single quotes, I think this might be the issue; you check the code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM