Showing posts with label VS 2013. Show all posts
Showing posts with label VS 2013. Show all posts

Friday, 17 January 2014

SQL Server Data Tools Projects Error with the file _Data.sqlinclude


I am having problem to build the project.  The error is:

  • SQL71006: Only one statement is allowed per batch. A batch separator, such as 'GO', might be required between statements.

Solution:

  • Set the Build Action of the file to "None".  It was set to "Build".

More info:

  • Make sure the file (Data\_Data.sqlinclude) is NOT Read Only.
  • Have a Pre-Build event to generate the file with Data\_Data.tt


set doTemplateTransform=
if "$(BuildingInsideVisualStudio)"=="True" set doTemplateTransform=true

if "%doTemplateTransform%"=="true" "$(MSBuildProgramFiles32)\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe" "$(ProjectDir)Data\_Data.tt" -a "!!targetDir!$(ProjectDir)Data"