Question

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.

Was it helpful?

Solution

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:\...\"
------------------------------------------^
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top