visual-studiosqlcmd

Adding a SQLCMD file to Visual Studio Solution causes Errors


I have an implementation script written in SQLCMD. We store these scripts in our Visual Studio solution file, under a DB project.

This script throws a ton of errors because VS thinks it's bad SQL. It doesn't seem to recognize it as a SQL command file.

"SQL70001: This statement is not recognized in this context."

Is there a different extension I should be using other than .SQL to quiet VS down? I don't need pages of useless errors when working on code.


Solution

  • In properties change build action to none.

    https://arcanecode.com/2013/03/28/ssdt-error-sql70001-this-statement-is-not-recognized-in-this-context/