Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy multiple databases with SSDT

We have an existing system with multiple databases on one SQL Server instance, and we want to deploy database changes using SQL Server Data Tools. Thus I've created a solution with one database project per database.

When I run a build, it creates a .dacpac file for each project. Ideally we want to bundle the deployment of database changes, such that all databases are deployed in one shot. I've seen that database projects can reference other projects and suppose that you can use this mechanism for bundling as well - but I am reluctant to add references just for the sake of deployment.

What is the recommended way to deploy multiple databases in one package?

like image 977
Hermann.Gruber Avatar asked Aug 24 '26 18:08

Hermann.Gruber


1 Answers

I don't think you can do this. By default, each database gets its own dacpac. You can set up a script that can build/publish all databases in one shot, but it will do them one at a time. I created a basic batch file some time ago that would build all of the dacpacs and publish each of them in order.

like image 107
Peter Schott Avatar answered Aug 26 '26 17:08

Peter Schott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!