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
167
votes
4 answers

Error in SQL script: Only one statement is allowed per batch

I have 4 sql scripts that I want to run in a DACPAC in PostDeployment, but when I try to build the VS project for 3 of them I get this error: Only one statement is allowed per batch. A batch separator, such as 'GO', might be required between…
Cosmin Ionascu
  • 7,018
  • 5
  • 25
  • 42
25
votes
2 answers

Best Practices of continuous Integration with SQL Server project or local mdf file in project

Today I maintain project that has really messy DB that need a lot of refactor and publish on clients machines. I know that I could add a SQL Server Database project that contains just scripts of the database and creates a .dacpac file that allows me…
teo van kot
  • 12,350
  • 10
  • 38
  • 70
24
votes
4 answers

SSDT Publish errors on Creating Publish Preview

I am using Visual Studio 2013 to manage a .sqlproj file containing our database schema. The schema has been deployed successfully dozens of times. When attempting to publish to one specific target database, the "Creating publish preview" step…
Eric Patrick
  • 2,097
  • 2
  • 20
  • 31
22
votes
3 answers

What does DACPAC stand for?

In Visual Studio 2012 we have new project type called SQL Server Database Project and when compiled will create a .dacpac output file. A Google for this term will link it with Data-tier Application but I cannot link this name with D A C P A and…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
16
votes
3 answers

How to capture DacSevices.Deploy output?

So I've managed to deploy our DACPAC schema via Octopus. I'm using a Deploy.ps1 script interacting with .Net objects just like the article describes. I'd like to make the deployment process more transparent by including the "standard output" you…
David Peters
  • 1,938
  • 1
  • 20
  • 18
14
votes
4 answers

DacPac exclude users and logins on export or import

Im doing some automation and in the middle of rewriting some 10-15 old, quirky scripts to one single and simple unit, which can: Export a database scheme from MsSql2012 in production environment Import the database scheme to MsSql2012 in…
Christian Mikkelsen
  • 1,661
  • 2
  • 19
  • 44
12
votes
3 answers

DACPAC and SQL Sequence

I have a Visual Studio database project (DACPAC) which includes a number of SQL Sequences. However when I deploy the DACPAC it always resets the sequence value to the default value included in the Create script (in this case 1). e.g. CREATE SEQUENCE…
12
votes
2 answers

How to publish DACPAC file to a SQL Server database project via SQLPackage.exe of SSDT?

I'm using SSDT for Visual Studio 2012 here and using its command-line tool SQLPackage.exe to publish a .dacpac file. I want to publish that to an SQL Server database project. I'm trying to use parameter at this guide but cannot find ways how to do…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
12
votes
2 answers

How to traverse a dacpac

We are looking to upgrade our dbproj to a sqlproj so that we can point it to a new SQL 2012 database. We have a program at the moment that reads the .dbschema xml file to find all tables and columns and retrieve information from them. We use this…
Greg
  • 3,442
  • 3
  • 29
  • 50
11
votes
2 answers

Error: The reference to external elements from the source named 'master.dacpac' could not be resolved

I am building a database dacpac using sqlpackage on a windows machine. The project contains a reference to master.dacpac I take the move the dacpac to a linux machine (mssql-server-linux docker image) and restore the database. deploy-database.sh #…
Eamonn McEvoy
  • 8,876
  • 14
  • 53
  • 83
11
votes
2 answers

How to deploy temporal tables with dacpac and SqlPackage.exe

We are trying to work with temporal tables in SQL Server 2016. We are developing the SQL scripts in SSDT 15.1.6 in Visual Studio 2017, but we are experiencing issues when trying to deploy the dacpac that is generated during the build. Our dacpac is…
larrydice
  • 321
  • 2
  • 9
11
votes
3 answers

SSDT project builds much slower with MSBuild than in VS 2013

I noticed that our SSDT projects were building much slower via TFS build definitions than via VS 2013 on my local dev box. On the build server itself, I can build our largest SSDT project via VS 2013 in about 2 minutes. The exact same project builds…
Mark Neves
  • 330
  • 2
  • 10
10
votes
1 answer

How can I update a nullable column to be not nullable, in SQL Server using DACPAC

I'm trying to update a database that is maintained and deployed using a database project (.sqlproj) in Visual Studio 2012. This is easier with SQL Server Management Studio, but in this case I have to deploy using a DACPAC. What is the correct way…
mafue
  • 1,858
  • 1
  • 21
  • 27
10
votes
2 answers

How to make DACPAC update only one schema?

I have a VS2013 solution with *.sqlproj project that contains objects specific to this solution. The issue is that this is database common also for other projects. My problem is to automatically deploy changes within my schema to database without…
9
votes
3 answers

Find Sqlpackage.exe on client machine to install DACPAC

I'm developing a .Net-application that would deploy a dacpac on a client machine. For that purpose I would require SqlPackage.exe to deploy the dacpac. I need a absolute path of SqlPackage.exe to make my application work irrespective of client's…
Yogesh Irmal
  • 111
  • 1
  • 1
  • 7
1
2 3
30 31