I am using SQL Server Management Studio to run a script on SQL Server 2008.
Following simple statement throws error “Incorrect syntax near ‘:'”.
:setvar DatabaseName "USHR1.2"
Curious, what’s going on here. Appreciate your help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
OK.. it was simple. Enabling the “SQLCMD Mode” from the SSMS menu solved the error. Thanks everyone for your replies.
I guess, there are tons of such “Incorrect syntax near ‘x'” errors reported on stackoverflow. Guess, those will go away with this fix.