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
2
votes
2 answers

Migrating .sqlproj to Sdk style breaks certain database options

I'm trying to migrate my existing .sqlproj targeting .NET Framework 4.7.2 to the new Sdk style project so that I can generate the .dacpac using the new .NET SDK. My new .csproj looks like this:
UserControl
  • 14,766
  • 20
  • 100
  • 187
2
votes
1 answer

Handling SQL Login/Passwords when deploying a VS Database Project (DACPAC)

After an initial publish to a SQL Server(2019) and after the initial create of my DB project (data tier app) when publishing again it is failing with a drift report. No changes done to the database externally or within the VS project. Drift…
JARRRRG
  • 917
  • 2
  • 14
  • 44
2
votes
1 answer

sqlpackage.exe to ignore a specific schema in DevOps Release pipeline

I want to ignore changes to a specific schema in the release pipeline in DevOps. I am trying to find the Sqlpackage.exe command for it. I checked the document here:…
2
votes
1 answer

Publish Profile (or schema compare) will not evaluate SQLCMD variables

SQLCMD variable substitution has been working in our project for years but after updating to VS 16.5 this stopped working. Publish Profile (or schema compare) will not evaluate SQLCMD variables. The generated script always includes any file that…
alexs
  • 1,507
  • 18
  • 17
2
votes
1 answer

Configuring default values for initial size and auto-growth size for database when publishing dacpac (SSDT Database project)

We use SSDT DB Projects to maintain and publish DB changes to SQL Server 2014 (and above). We're using DacFx API's in C# to publish dacpac files. Is there any way we can configure in the dacpac the Initial Size and Autogrowth size for both Primary…
ajeesh k
  • 93
  • 8
2
votes
1 answer

Dacpac deployment in azure refers value as invalid column name

I am trying to deploy dacpac where i am passing arguments as $(name)="dev". and in pre-deployment script have below code. DECLARE @SQL VARCHAR(254); BEGIN SET @SQL = 'INSERT INTO [dbo].[tblTest] (Id, name) VALUES (2, '''+$(name)+''');' …
Sumant
  • 954
  • 1
  • 18
  • 39
2
votes
1 answer

How to deploy DACPACs to transaction replicated databases

I am deploying a DACPAC via SqlPackage.exe to database servers that have a large volume of transaction replication in SQL Server. The DACPAC is built as the output of a SQL Server Database Project. When I attempt to deploy the DACPAC to the…
2
votes
0 answers

SSDT: Error: Deploy72002: Identifiers must include at least one name (for example, MyTable). Done building project "Common.sqlproj" -- FAILED

While i'm trying to PUBLISH my SSDT DB projects getting the below error: Identifiers must include at least one name (for example, MyTable)" We need to deploy 65 SSDT projects and unable to fix this issue. Resolutions tried : Deleting .refactorlog…
2
votes
1 answer

Azure SQL database creation issue from dacpac

I am trying to create new SQL Azure database using dacpac file created from local SQL server database using SSDT . I am getting error as Publish failed.An error occured during deployment plan generation. Deployment cannot continue. A project which…
2
votes
1 answer

Azure SQL Server database user login disabled after DACPAC publish

I have CICD pipeline setup for deploying the database using DACPAC. I have arguments for sqlpackge.exe here /p:ExcludeObjectTypes="Users;RoleMembership;Logins;ServerRoles;ServerRoleMembership" This works fine, the users for the database is disabled…
Benzhi Pan
  • 161
  • 1
  • 14
2
votes
1 answer

Release Pipeline error when using Azure Dacpac Task

I'm new to using Azure release pipelines and have been fighting issues trying to deploy a database project to a new Azure SQL database. Currently the pipeline is giving me the following error... TargetConnectionString argument cannot be used in…
2
votes
1 answer

Cannot delete column with only null values when BlockOnPossibleDataLoss=true

I'm using a blue-green deployment strategy with expand contract database pattern. To achieve that on my database deploy schema I've setted the property BlockOnPossibleDataLoss=true because on Expand phase I can modify my database without any break…
Matheus Xavier
  • 397
  • 2
  • 11
2
votes
3 answers

Visual Studio SSDT Database project (.sqlproj) build - generate .dacpac using CLI without MSBUILD (msbuild.exe)

Looks as though dotnet CLI has no support for Database projects (.sqlproj) according to this: https://github.com/dotnet/sdk/issues/8546 in my case dotnet build fails with the following error: C:...*.Database.sqlproj(59,3): error MSB4019: The…
Ruslan
  • 9,927
  • 15
  • 55
  • 89
2
votes
2 answers

Visual Studio - Publish dacpac as NuGet package in so other DB Projects can reference the DB

I'm working on setting up a new organization where we are currently using VS 2017 and creating many SQL Server (2016) DB projects. I've set up a private NuGet server on Azure to be able to use packages in each new project and my ideal solution would…
John Bustos
  • 19,036
  • 17
  • 89
  • 151
2
votes
1 answer

Incredibly slow DACPAC deploy from DevOps to an Azure with deployment pipeline

Azure DevOps release pipeline takes ages(around 25mins) to deploy the dacpac. I'm pretty sure this can't take this much time. something unusual here. After the research, I corrected some warnings but those are not that important. but now there are…
tech-gayan
  • 1,373
  • 1
  • 10
  • 25