Database Pro Deployment
There is a 2008 continuous integration build for a database pro project. It needs to deploy to 3 databases. I cannot figure-out how to configure the build to deploy to all 3. How is that done?
Answers
Hi Dave,
Do you mean that there are 3 database project in a solution? You can run 3 MSBuild task to deploy these databases in "AfterDropBuild" Target.
<Target Name="AfterDropBuild">
<Message Text="Deploy of project database" />
<MSBuild
Projects="$(SolutionRoot)\src\DbSolution\DB1\DB1.dbproj"
Properties="OutDir=$(DropLocation)\$(BuildNumber)\debug\;TargetDatabase=DB1;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data;TargetConnectionString=Data Source=server%3Buser=sa%3Bpwd=Pa$$w0rd;DeployToDatabase=true;"
Targets="Deploy" />
<MSBuild
Projects="$(SolutionRoot)\src\DbSolution\DB2\DB2.dbproj"
Properties="OutDir=$(DropLocation)\$(BuildNumber)\debug\;TargetDatabase=DB2;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data;TargetConnectionString=Data Source=server%3Buser=sa%3Bpwd=Pa$$w0rd;DeployToDatabase=true;"
Targets="Deploy" />
<MSBuild
Projects="$(SolutionRoot)\src\DbSolution\DB3\DB3.dbproj" Properties="OutDir=$(DropLocation)\$(BuildNumber)\debug\;TargetDatabase=DB3;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data;TargetConnectionString=Data Source=server%3Buser=sa%3Bpwd=Pa$$w0rd;DeployToDatabase=true;"
Targets="Deploy" />
</Target>
If my understanding is not right , please let me know
Best Regards.
Ruiz Yi
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi- Marked As Answer byDaveIII Wednesday, November 11, 2009 2:39 PM
All Replies
Hi Dave,
Do you mean that there are 3 database project in a solution? You can run 3 MSBuild task to deploy these databases in "AfterDropBuild" Target.
<Target Name="AfterDropBuild">
<Message Text="Deploy of project database" />
<MSBuild
Projects="$(SolutionRoot)\src\DbSolution\DB1\DB1.dbproj"
Properties="OutDir=$(DropLocation)\$(BuildNumber)\debug\;TargetDatabase=DB1;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data;TargetConnectionString=Data Source=server%3Buser=sa%3Bpwd=Pa$$w0rd;DeployToDatabase=true;"
Targets="Deploy" />
<MSBuild
Projects="$(SolutionRoot)\src\DbSolution\DB2\DB2.dbproj"
Properties="OutDir=$(DropLocation)\$(BuildNumber)\debug\;TargetDatabase=DB2;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data;TargetConnectionString=Data Source=server%3Buser=sa%3Bpwd=Pa$$w0rd;DeployToDatabase=true;"
Targets="Deploy" />
<MSBuild
Projects="$(SolutionRoot)\src\DbSolution\DB3\DB3.dbproj" Properties="OutDir=$(DropLocation)\$(BuildNumber)\debug\;TargetDatabase=DB3;DefaultDataPath=C:\Program Files\Microsoft SQL Server\MSSQL.4\MSSQL\Data;TargetConnectionString=Data Source=server%3Buser=sa%3Bpwd=Pa$$w0rd;DeployToDatabase=true;"
Targets="Deploy" />
</Target>
If my understanding is not right , please let me know
Best Regards.
Ruiz Yi
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi- Marked As Answer byDaveIII Wednesday, November 11, 2009 2:39 PM


