Questions tagged [dacpac]

DACPAC, or Data-tier Application Component Packages, is a feature in SQL Server 2008 that allows developers to package database changes into a single file in Visual Studio and send it to the DBAs for deployment.

With DACPAC, DBAs get a single deployment file from the developers that contains all the changes; there's nothing to misunderstand or forget.

In the final step, it drops the original database and gives the new one the proper name. You can easily see that creating an entirely new copy of the database for a small code change won't fit into most situations.

Further, DACPAC doesn't copy user permissions or work with service broker or replication objects.

A DACPAC can be seamlessly used across multiple tools that ship with SQL Server 2012. These tools address the requirements of different user personas using a DACPAC as the unit of interoperability.

Application Developer

  1. A database developer can use a SQL Server Data Tools database project to design a database. A successful build of this project results in the generation of a DACPAC contained in a .dacpac file.
  2. In addition, the developer can import a DACPAC into a database project and continue to design the database. SQL Server Data Tools also supports a Local DB for unconnected, client-side database application development. The developer can take a snapshot of this local database to create DACPAC contained in a .dacpac file.
  3. Independently, the developer can publish a database project directly to a database without even generating a DACPAC. The publish operation follows similar behavior as the deploy operation from other tools.

Database Administrator

  1. A DBA can use SQL Server Management Studio to extract a DACPAC from an existing database, and also perform other DAC operations.
  2. In addition, the DBA for a SQL Database can use the Management Portal for SQL Azure for DAC operations. Independent Software Vendor
  3. Hosting services and other data management products for SQL Server can use the DACFx API for DAC operations.

IT Administrator

  1. IT systems integrators and administrators can use the SqlPackage.exe command line tool for DAC operations.

Source infinitecodex
Source microsoft

454 questions
4
votes
1 answer

SSDT Unresolved Reference to Object

I'm receiving a number of "unresolved reference to object" errors on a SQL Server Database Project I created in VS 2017. These errors all point to the "sys." objects. I have added a .dacpac reference from the master database, including generating a…
Vickey C
  • 41
  • 1
  • 6
4
votes
1 answer

Migrating from TFS to VSTS - Reducing TPC Database Size

We are planning a migration from an on-premises TFS instance to VSTS very shortly. Ahead of the migration, we run the pre-requisite Validation task and obtained the following output report on the TPC database size: "The database is currently 191GBs.…
hitman126
  • 699
  • 1
  • 12
  • 43
4
votes
2 answers

VSTS build doesn't pickup the dacpac file (hosted agent in cloud)

I'm trying to use VSTS to deploy into my database, the problem is in one of the steps I need to pick up the dacpac file and deploy it to the Azure SQL server but it fails: in that step, I'm using "Execute Azure SQL: DacpacTask" which is provided by…
Farzad J
  • 1,089
  • 2
  • 14
  • 28
4
votes
1 answer

SSDT How can I create a new database from a DACPAC file?

Currently using SqlPackage.exe cmd line tools to generate a script, by comparing DacPac file with a target database. This will Create the database if it doesn't already exist. We now want to switch this to use the Microsoft.Data.Tools.Msbuild Nuget…
Fish
  • 138
  • 1
  • 7
4
votes
2 answers

SQLPackage not found in SQL Server on Linux

I am trying to do dacpac deployment using SQLPackage on Linux. My environment: Server : Ubuntu Linux version 16.04 SQL Server 2017 latest release candidate version RC1. SQL Server installation is successful and I am able to create tables on SQL…
Kannan Kandasamy
  • 13,405
  • 3
  • 25
  • 38
4
votes
0 answers

DACPAC deployment fails on EXTERNAL DATA SOURCEd schemas

(Here is a problem with a similar issue: Publish to SQL Azure fails with 'Cannot drop the external data source' message) There is this new pattern called Sql Db Elastic Query (Azure). The gist of it is captured…
4
votes
2 answers

Rolling back a failed DACPAC with SqlPackage.exe

I have regularly used EF migrations to deploy databases, both from scratch and for evolution. I am currently however working on another teams project that use DACPACs, which seemed just as good, until today. Today, I added a Unique Key Constraint to…
Michael Armitage
  • 1,502
  • 19
  • 17
4
votes
1 answer

Deploy dacpac with variable substitution with powershell

We have the function below that deploys a dacpac. I have been looking to see how to pass variables for the dacpac. Is this possible? Function DeployDB { param( [string]$SqlServerName = $( throw "Missing required parameter SqlServerName"), …
MrBeanzy
  • 2,286
  • 3
  • 28
  • 38
4
votes
1 answer

Deploy DACPAC with SqlPackage.exe with references to master and msdb

We have a Visual Studio DB-project that has DB-objects that reference to the 'master'- or 'msdb'-database. Now there are two cases: (1) With having NO references to the system databases 'master' and 'msdn' in the project settings, it is possible…
user1027167
  • 4,320
  • 6
  • 33
  • 40
4
votes
1 answer

Deploying a via code dacpac without deploying database properties

I have a dacpac file which I am deploying via an application using the DacServices library. I have the following code to do it: var dp = DacPackage.Load(dacpacPath); var dbDeployOptions = new DacDeployOptions { BlockOnPossibleDataLoss =…
Laurence Frost
  • 2,759
  • 3
  • 28
  • 45
4
votes
2 answers

Generate Smart Defaults, when Applicable, using SQL Management Studio

I am currently working on a project to publish our database as a data tier application. The database is fairly complex and has required several parameters to be modified when either using SQLPackage.exe or publishing via Visual Studio. One of the…
Slavvy
  • 551
  • 7
  • 13
4
votes
1 answer

Can I import BACPAC with data into DB project?

I have a database with data that I want to turn into a Visual Studio 2012 SQL Database project. I tried using "Import->Data-tier application (*.dacpac)..." - I get no errors but no data gets imported (and there is no option to include data). How can…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
3
votes
1 answer

Sql Linux docker container throws error when trying to deploy dapac: The path specified by File Ggroup FG.mdf file is not in a valid directory

I am trying to deploy a .dacpac which was generated from a SQL connection string into a SQL server 2017 ubuntu docker container for integration testing. I am using the DacFx NuGet package from Microsoft to generate the .dacpac. I tried to find…
David P
  • 71
  • 1
  • 6
3
votes
2 answers

Azure DevOps Azure SQL DacpacTask SQL72018 Permission Could Not Be Imported

We have a release pipeline in Azure DevOps that deploys a database project to our Azure SQL Database via the Azure SQL Dacpac Task. Everything has been working fine but suddenly yesterday the pipeline started failing with the following…
3
votes
1 answer

DacFx and Custom DeploymentContributor (AgileSqlClub.DeploymentFilterContributor)

I've tried at least a dozen or so ways to get the module to load and work but still get the same error:  Error SQL0: Required contributor with id 'AgileSqlClub.DeploymentFilterContributor' could not be loaded. I've tried to run it with…