Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the pre- and post-deployment scripts in VS2013 Database Projects?

According to everything I've read about the "SQL Server Database Project" template in Visual Studio 2013, there should be a 'Scripts' folder when you create the project containing pre- and -post deployment SQL scripts that you want to be executed on publication.

When I create a new, blank DB project, the only structures I can see are the 'properties' and 'References' nodes:

enter image description here

I've tried manually adding SQL scripts according in the correct folders according to the articles I've read online, but still no joy. I would say the MSDN docs seem to refer mainly to VS2010 or at best 2012 DB projects, for example this MSDN page which assumes that the 'Scripts' folder has been populated as part of the project creation.

I've also tried installing the November 2014 updates to SQL Server database tooling via the VS2013 updates menu, and creating a new DB project, with the same results.

like image 486
Matt Avatar asked Jan 15 '15 10:01

Matt


1 Answers

If you try to add a new item to the project, two of the script templates on offer are a Pre-Deployment script and a Post-deployment script.

enter image description here

Alternatively, if you just add a normal script to the project, you can later mark it for Pre-/Post- deployment via the "Build Action" property:

enter image description here

There are no longer dedicated folders for these scripts.

like image 134
Damien_The_Unbeliever Avatar answered Nov 15 '22 19:11

Damien_The_Unbeliever