visual-studio-2015schema-compare

Visual Studio Professional 2015 - SQL Schema Compare & reopening .publish.sql generated scripts


Not sure if this has been an issue before or this is a new error with the latest tools update, however:

I've noticed that after running a comparison between two database and clicking on the "Generate Script" that the *.publish.sql will run perfectly.

However, after saving that file, closing it and re-opening, the

:setvar 

blocks are all coming back as incorrect syntax.

Is this a bug in VS or am I doing something wrong?


Solution

  • You must switch to SQLCMD mode.

    --- In Visual Studio 2015:

    enter image description here