1

I downloaded an AdventureWorks 2012 LT Script from CodeProject, but when I try to run it it says:

Incorrect syntax was encountered while parsing :setvar.

There's nothing more than this:

:setvar SqlSamplesDatabasePath   "C:\Program Files\...\DATA\";
:setvar SqlSamplesSourceDataPath "C:\Samples\...\";

And yes, I set the SQLCMD mode on.

1 Answer 1

3

Yes, don't put semi-colons at the end of any SQLCMD lines; this is not T-SQL and is subject to different parser / interpreter rules and syntax.

:setvar SqlSamplesDatabasePath   "C:\...\"
:setvar SqlSamplesSourceDataPath "C:\...\"
------------------------------------------^
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I fell foul of this too. Surprisingly, these semicolons are in Microsoft's distribution of AdventureWorks LT 2012 on msftdbprodsamples.codeplex.com : Well, they got that one wrong, didn't they!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.