Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSDT Generating non SQLCMD deployment scripts

I am using SSDT to manage my database. Right now it generates SQLCMD deployment scripts. Is there any way to have it generate plain t-sql scripts?

like image 444
user1807002 Avatar asked Nov 12 '12 19:11

user1807002


1 Answers

Short answer: No. They were designed to work this way.

Longer Answer: No. SQL Projects use a lot of the SQLCMD commands to manage variables and such when releasing the database. Those can be passed in from the calling application in ways that standard T-SQL can't handle or can't handle well. One improvement that was made in SSDT over the older DB Projects is that you're now told that SQLCMD isn't enabled so the script won't run at all.

I'm not sure of your scenario, but you can automate the build/publish of the projects using SQLPackage. We've done that for our developer team so they can easily refresh their local working copies without having to open the projects or run scripts.

like image 102
Peter Schott Avatar answered Sep 28 '22 12:09

Peter Schott