When using the Visual Studio SQL Compare to compare your database schema to your physical database it returns heaps of false positives, where SQLCompare is suggesting that your CMD variable does not match what is on the database.
SQLCompare uses the default or local CMD variables that you have on your project when performing the compare.
You need to ensure the default variables match the target database you are comparing against.
To change your defaults open the properties of your Database project, switch to the “SQLCMD Variables” tab and edit the defaults.
When you get your variables in alignment with your target comparison database you will get a true indication of the differences.
You create a post deployment script, with a statement like;
:r .\Static Data\Insert Seed Values.sql
The system throws an error and will not build:
72006: Fatal scripting error: Incorrect syntax was encountered while parsing ‘Data\Insert’
There are two problems:
- The post deployment script does not like spaces in the file paths, so quote the file path in “double quotes”.
:r ".\Static Data\Insert Seed Values.sql"
- The post deployment script runs in SQL CMD mode, so whilst ever you have the script file open it will throw syntax errors either
- Close the post deployment script; or
- Turn on SQL CMD mode on the file, (in 2012 with latest SSDT this is the last icon in the toolbar