However, you can execute any SQL script during the post deploy process in your SQL Server project as:
1. Write your script into a file called postdeployscript.sql:
2. Add the file to your project by right clicking your project in Solution Explorer and Add à Existing Item.
Make sure you add this in the root of the project and not in the Test Scripts. When you click deploy, Visual Studio will automatically run this scripts after the deployment of your project.
Same holds for predeployscript.sql if you want to execute a script on the SQL server before deployment.
These scripts can be used to automate something that Visual Studio does not currently support.
Thanks,
-Vineet.
postdeployscript.sql and predeployscript.sql are the things I dreamed about all the time
. You should definitely include them into default template of SQL Server Project, because I was searching for this solution for two months until I found this post. I asked similar question on the TechNet and the answer was just "you cannot do it".
No comments:
Post a Comment