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
3
votes
1 answer

How to update an SSDT project from the command line?

I hope to be able to use SSDT (SQL Server Data Tools) to put our database schema under version control. Importing a database into an SSDT project in Visual Studio creates a nice textual representation of the database schema, suitable for…
Ola Eldøy
  • 5,720
  • 7
  • 49
  • 82
3
votes
3 answers

ssdt dacpac: how to prevent dacpac to generate the error when dropping columns in a table with data

I am dropping a column in a table xxx with data. The DACPAC is generating the checking as follow. IF EXISTS (select top 1 1 from [dbo].[xxx]) RAISERROR (N'Rows were detected. The schema update is terminating because data loss might occur.', 16,…
beewest
  • 4,486
  • 7
  • 36
  • 63
3
votes
1 answer

SqlPackage.exe command throwing errors after upgrade

We use PowerShell scripts to deploy SQL database. This scripts are using SqlPackage.exe utility to publish our main database, it was working fine until we upgraded SSDT to it's latest release SSDT 2015 when it stated to throw the error…
3
votes
1 answer

Octopus Deploy.ps1 DACPAC Deployment Fails

I'm using Octopus on TeamCity to deploy a database to our production environment, but it keeps giving an error. Here is the Deploy.ps1 code: $dbName = $OctopusParameters['DBName'] $dbUser = $OctopusParameters['AdminDBUsername'] $dbPassword =…
Michelle
  • 231
  • 3
  • 16
3
votes
1 answer

DacFx DeploymentPlanExecutor OnExecute not called

I'm trying to program a custom DeploymentPlanExecutor using Microsofts DacFx 3.0 but the OnExecute-Method is never called. If I use an identical DeploymentPlanModifier instead, OnExecute() is called as expected. No matter whether I add the…
user4758246
  • 575
  • 5
  • 13
3
votes
0 answers

SSDT: incremental update script including data using sqlpackage.exe

I have an SSDT project with VS2015 and using SqlPackage.exe to generate deployment scripts and incremental update scripts. The database project contains post deployment scripts. here's how I generate the main script for DB…
3
votes
1 answer

Continuous integration with ssdt

So I've been looking at sql server data tools (ssdt) and seen some info to suggest it was possible to do continuous integration with Microsoft database projects and I'm just wondering if anyone is actually doing this in practice. The dacpac…
Shaunt
  • 183
  • 1
  • 3
  • 11
3
votes
1 answer

Overriding DefaultDataPath and DefaultLogPath variables when using SqlPackage to publishing a dacpac

The environment: Using a SQL Server Database Tool in Visual Studio 2013, Update 4 to create a DacPac for publishing a database. Using TFS build to build and drop the database project. Using SqlPackage version to publish the dacpac to SQL Server…
jlo
  • 1,121
  • 1
  • 11
  • 16
3
votes
3 answers

Create user script with variable domain user login

We have a DACPAC that has a create user script. The user has a log in that needs to be set to a windows domain user When we do a build for Test/Staging/Release we need to be able to apply a different domain and user for the users log in. I thought…
TechLiam
  • 137
  • 1
  • 3
  • 10
3
votes
2 answers

Stored Procedure changes not reflecting in dacpac script

I have added a new stored procedure and added it to my sqlproj file. But when I generate script to publish my database, the changes are not getting reflected in the generated script.
3
votes
1 answer

User Created Using DACPAC Cannot Log On

I have a Visual Studio 2013 SQL Database Project which creates a DACPAC file for deployment of the SQL database to SQL Server using the "Deploy Data-tier Application..." option is SQL Server Management Studio (SSMS). As part of the project, there is…
Martin Costello
  • 9,672
  • 5
  • 60
  • 72
2
votes
1 answer

Use SQLCMD Variables for User Name in DACPAC

I am trying automate the creation of users in a Synapse Dedicated SQL Pool. Building and integrating a DACPAC in an Azure DevOps pipeline works as described in the Microsoft Documentation. The problem is, that i want to specify the username at…
woozy
  • 33
  • 7
2
votes
1 answer

Login failed during Azure Release Pipeline DACPAC deployment

I am trying to deploy a dacpac to a database in Azure SQL server using a release pipeline in azure devops. I was able to deploy a dacpac to one database successfully by adding Azure Object Name as db_owner of that database. I repeated the same step…
2
votes
1 answer

DACPAC SQL Server dropping schema permissions

I am trying to use a DACPAC database project in Azure Data Studio. So far, it works fine except for the "publishing" of the project to the actual DB. When I generate the delta script, I see that all permissions on all schemas are being dropped. I…
Chris
  • 143
  • 7
2
votes
2 answers

Azure Devops SQL DacpacTask failing for Azure Key Vault

I'm trying to deploy a dacpac to an Azure Sql Database with Always encrypted enabled. The Devops agent is running in a self-hosted VM with sqlpackage.exe version 19 with build 16.0.5400.1 installed on it. I've been able to trace down the issues by…