SSDT Release, unable to use SQLCMD commands in scripts - by Peter A. Schott

Status : 

  Duplicate<br /><br />
		This item appears to be a duplicate of another existing Connect or internal item.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 741027 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 5/7/2012 4:42:43 PM
Access Restriction Public


When trying to include scripts for post-deployment, SSDT is reporting problems in a called script (not part of the build) with the ":On Error Ignore" command used for SQLCMD scripts.

I don't know if this is due to nesting SQLCMD scripts, but this worked with VS2010 DB Projects and did not raise errors. Within SSDT, this generates an error and prevents the project from building.

When building, we get an error "SQL72006: Command On Error is not supported."
Sign in to post a comment.
Posted by deadlydog on 3/14/2013 at 3:29 PM
Just noticed this is "Closed as Duplicate", but there is no link/reference to the duplicate work item. Can you provide us with a link to the original ticket so that we can follow this issue please.
Posted by deadlydog on 3/14/2013 at 3:27 PM
So is there any alternative to ":on error exit" that we can use? Our organization too used ":on error exit" in our VS 2010 .dbproj project, but get the mentioned error after converting to a VS 2012 .sqlproj project.
Posted by Adam [MSFT] on 5/11/2012 at 11:06 AM
Hi Peter,

Thanks for giving us feedback regarding SSDT and your scenario. Currently SSDT does not support the ":on error ignore"
or ":on error exit" SQLCMD syntax in pre- or post-deployment scripts, even when SQLCMD mode is enabled. Nesting included files does not play into the scenario, the syntax is just currently not supported in the project system. This issue is on our radar and we will look to address it in a future release.

Let us know if there is anything else that we can help with.

Adam Mahood
Program Manager