Pre and Post Deployment Events

Visual Studio makes it relatively easy to hook in to pre and post build events, by using the Project properties tab named Build Events. However when using Database Projects (.dbproj) you more often need to do something at deployment time. The good news is that the standard MSBuild framework, already defines these events, the bad…

1

Pre-Deployment Scripts

Pre-deployment script do not change the outcome of deployments! The above statements is something that most users do not realize when using pre-deployment scripts. Since the pre-deployment script is included in to the deployment script, it therefore by definition runs after the comparison the the source model with the target database (model), and therefore cannot…

2

Assigning MSBuild Properties to SQLCMD Variables

I am receiving the following question a lot: How do I propagate MSBuild properties to SQLCMD variables. In order to make the Visual Studio 2008 Team System Database Edition GDR release use the data from an MSBuild property inside a SQLCMD variable you need to do three things: Add the variable to the Database.sqlcmdvars file…

7