benjamin moskovits
benjamin moskovits

Reputation: 5458

DACPAC file does not make sense

When I create a DACPAC file and I then expand the DACPAC file and then open the file with the 'SQL' extension it contains all the create statements. I notice that at first it creates objects and then at the end of the file creates the schemas. When I run the first create for an object that is not dbo it fails, naturally. What is really being executed when the DACPAC is applied?

Upvotes: 0

Views: 92

Answers (1)

Piotr Palka
Piotr Palka

Reputation: 3169

DACPAC contain a definition how the database should looks like after it is deployed.
Deployment process runs a schema compare between content of dacpac and target database and then deployment package decides which objects should be dropped, altered or created.
Order of the operations is also decided by deployment engine, not dacpac itself.

To execute this process you can use SqlPackage.exe: https://learn.microsoft.com/en-us/sql/tools/sqlpackage?view=sql-server-ver15

Upvotes: 1

Related Questions