Search code examples
sql-serversql-server-data-tools

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?


Solution

  • 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.