Is there a method/ mechanism available to run a different set of post-deployment scripts in the SSDT-based database project in Visual Studio 2012/ 2013, based off of the build configuration? I would like to pre-populate my data for testing/ continuous integration by deploying with a "Testing" configuration, but naturally don't want to do this for other environments. I can't seem to find a way to conditionally link a post-deployment script to a build configuration, though, and that seems really strange to me.
相关问题
- Custom controls disabled. There was an internal is
- Resharper 7 on VS2012 ignores assembly redirect in
- Error installing MVVMCross from nuget into a PCL
- Why can't I bind to winproc?
- Getting Sum of an SQL table column until the sum r
相关文章
- Web Test recorder does not allow me to record a te
- Visual Studio Hangs on Loading UI Library
- The program '[4432] iisexpress.exe' has ex
- How to disable CodeLens' references display in
- Breakpoint in ASP.NET MVC Razor view will not be h
- “Csc.exe” exited with code -1073741819
- Why doesn't my .tfignore file ignore my packag
- Cannot add a Data Source in web project using the
You can use SQLCMD variables as well to do something similar. If the value == "Test", run one set of values. If not, run something else. I blogged about that here:
http://schottsql.blogspot.com/2013/05/trick-to-not-run-prepost-sql-on-publish.html
It's not done on build and the scripts are always included this way, but if that's not an issue it gives you a way to easily write the code to run on various environments easily.
You can do this by editing the .sqlproj file used by MSBuild. Then when you build in "Testing" configuration you get different dacpac contents to when building in "Release" mode. For example:
<ItemGroup Condition=" '$(Configuration)' == 'Release' "> <PostDeploy Include="Debug.PostDeployment1.sql" /> </ItemGroup>