views:

259

answers:

1

I'm using Visual Studio Team System 2008 with GDR Version 9.1.40413.00 and am trying to resolve the issue of deploying a single DB project to multiple databases. For instance if I have a Performance.DB project I would like to deploy databases called Performance, Performance2, Performance3 etc.

However it seems if you go to the properties of the db project you can only have 1 deploy target. Is there a way round this? I would also like each Performance db to have its own sqlcmdvars file so it'll have its own unique mdf and ldf files.

If this is not possible to do from the properties within the project would there then be a way of creating a batch script that will execute for example the following command multiple times for each database I want to deploy - when I deploy the project?

"D:\Program Files\Microsoft Visual Studio 9.0\VSTSDB\Deploy\vsdbcmd.exe" /ManifestFile:"D:\Performance\Test\Binaries\Release\Performance.DB.deploymanifest" /a:Deploy /cs:"Data Source=.\SQLEXPRESS;Integrated Security=True;Pooling=False" /p:GenerateDropsIfNotInProject=True /p:BlockIncrementalDeploymentIfDataLoss=False /p:TargetDatabase=Performance /p:SqlCommandVariablesFile="D:\Performance\Test\Binaries\Release\Performance.sqlcmdvars" /p:IgnorePermissions=True /p:GenerateDeployStateChecks=False /dd:+
A: 

You could try and look at partial database projects.

Here is an example http://blogs.msdn.com/gertd/archive/2008/10/05/partial-projects.aspx.

They are useful for sharing code from one database project to another, although it may not be so great on a full project scale.

Using this your core Perfomance database project would be the "base" project and all others would derive from this.

Matthew Pelser