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.

Filter by
Sorted by
Tagged with
5 votes
1 answer
4k views

Deploy Dacpac packages via power shell script to Azure SQL Server

I'm trying to deploy multiple dacpac's during single build process by using PowerShell script. param( [string]$publish_profile, [string]$path_to_snapshots, [string]$password ) #Load ...
  • 148
9 votes
2 answers
13k views

DACPAC won't deploy because 'can't connect to server'?

I'm trying to deploy a DACPAC to LocalDB 2012 but it's just not having it: Stack trace is as follows: ================================== Could not deploy package. (Microsoft.SqlServer.Dac) --------...
  • 1,671
22 votes
3 answers
23k views

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 ...
  • 32.6k
14 votes
4 answers
14k views

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 ...
10 votes
2 answers
11k views

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 ...
5 votes
1 answer
13k views

Can I generate a deployment script from a dacpac

I've got a .dacpac file that's being called by MSBuild and published to a QA database for testing. This publish is failing and the error I'm getting back from them is a generic "an error has occurred" ...
5 votes
1 answer
1k views

Upgrading DACPACs with DACFx 3.0 API - How to inspect current DAC version of an existing database?

I am currently rewriting my team's database deployment Powershell script to use DACFx 3.0 API instead of 2.0. I've managed to get the DACPAC upgrade to work successfully, using the new Microsoft....
  • 193
3 votes
1 answer
277 views

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 ...
24 votes
4 answers
19k views

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 ...
  • 2,087
16 votes
3 answers
5k views

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 ...
  • 1,909
12 votes
2 answers
28k views

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 ...
  • 32.6k
10 votes
2 answers
2k views

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)...
9 votes
3 answers
3k views

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 ...
8 votes
1 answer
3k views

Adding Users to SQL Azure Database with ARM template

I am trying to create users inside DB and grant some specific permission each user; with the help of ARM template. But I do not find a way to do it using ARM. Can someone tell me is it supported by ...
  • 943
8 votes
2 answers
2k views

How to avoid data loss with EF Model First database schema upgrade?

This is a long question, but I would be very very thankful if I can get some good advice on this. In short, I’m looking for a good approach for version upgrade of MS SQL database schema that also ...
  • 2,639
8 votes
1 answer
4k views

Improve the performance of dacpac deployment using c#

We are deploying to MS SQL Server localdb for integration testing. We build a Database Project and the resulting dacpac file is copied in order to be used by the IntegrationTests project. So far we ...
7 votes
3 answers
7k views

What is "DacInstance with the specified instance_id does not exist. (Microsoft SQL Server, 36004)"?

I'm trying to upgrade a remote SQL Server 2012 database using a dacpac, but I'm getting the following message: DacInstance with the specified instance_id does not exist. (Microsoft SQL Server, 36004). ...
6 votes
2 answers
1k views

MSDeploy/WebDeploy - Deploy Composite Database Project via DacPac

We have a database project with views which join to tables in another database. The other database is in a different solution. This failed to build until we added a reference to a DacPac from the ...
  • 14.2k
5 votes
1 answer
960 views

Publish dacpac in single user mode using Microsoft.SqlServer.Dac.DacServices

I want to publish dac pac in single user mode to prevent unnecessary db changes while database is upgrading. For that I have used Deploy function in Microsoft.SqlServer.Dac.DacServices. That function ...
5 votes
2 answers
3k views

SQL Dacpac Deploy using SqlPackage and DropObjectsNotInSource with DoNotDropUsers

I am running SqlPackage in my CI build to deploy dacpacs and pass in a publish.xml file using the /Profile switch. I have the following three options set in the profile: <DropObjectsNotInSource>...
  • 3,648
5 votes
0 answers
1k views

Create User in dacpac deployed by SqlPackage.exe leads to login failed SqlException

Problem I'm trying to automate SQL deployment including User and Roles. It works when I create the user in Sql Management Studio, but when I deploy dacpack I get SqlException: Login Failed for user '...
  • 24.4k
5 votes
2 answers
6k views

How to check whether database user already exists in Azure SQL Database

My new client is planning to use Azure managed SQL Database services. I am using dacpac in order to deploy the database. In the dacpac, I have a post-deployment script in order to create a sql user as ...
5 votes
2 answers
4k views

DACPAC not including composite objects

I have a VS2012 database project which includes tables, stored procs, views etc. I then have a second database project which contains a database reference to the first project. I have ensured that ...
3 votes
1 answer
3k views

CREATE ASSEMBLY failed because assembly failed verification. Check if the referenced assemblies are up-to-date and trusted to execute in the database

A database with a CLR dll was migrated from SQL Server 2008R2 to SQL Server 2017. Deployment to this database is automated using DacPac in Azure DevOps. The dll is registered with EXTERNAL_ACCESS. ...
  • 2,394
3 votes
1 answer
713 views

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 ...
  • 5,661
3 votes
3 answers
3k views

How to disable predeployment and postdeployment scripts in DacServices.Deploy()

We have some automated dacpac deployment code which correctly handles both a CreateNewDatabase and straightforward Update database scenarios in C# using Microsoft.SqlServer.Dac Now in the ...
3 votes
1 answer
3k views

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 ...
  • 1,121
3 votes
1 answer
4k views

Facing errors while SQL deployment in azure devops pipeline

Am using sql DACPAC type of deployment in release pipeline of azure devops.but getting below error. I have no idea about SQL.Any suggestions? Publishing to database 'database_name' on server '...
user avatar
3 votes
1 answer
2k views

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

CI with a SQL Always Encrypted column

We are trying to add Always encrypted in one of our application and we would like to make it work with our CI flow. We are using DACPAC deploy with Azure Devops. Everything worked until now but we ...
2 votes
3 answers
3k views

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:...*....
  • 9,797
2 votes
1 answer
765 views

Get DataType of computed column from dacpac

When traversing a Dacpac via C# code, I am able to figure out which columns are referenced in a computed column (GetReferenced(Microsoft.SqlServer.Dac.Model.Column.ExpressionDependencies)), and what ...
2 votes
1 answer
4k views

Microsoft DacServices Powershell error on constructor when calling new-object

I have the following Powershell script I am trying to run: add-type -path "C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\Microsoft.SqlServer.Dac.dll"; $d = new-object Microsoft.SqlServer....
  • 75
1 vote
0 answers
227 views

DacServices.GenerateDriftReport throws sql server version Conflict

I have a microsoft sql server 2014 instance with a database "myDB". In SSMS I have registered this database as Datatier application. I have installed the latest dacfx with nuget to my visual studio ...
1 vote
1 answer
1k views

SQL Server : DacPac drops everything when another SSDT project is referenced

we have the following SSDT project structure: DBCore project: includes all objects that are not sql server edition exclusive. DBStandardEdition project: includes all standard edition specific objects....
1 vote
1 answer
449 views

Deploying SSDT project through Powershell Script: Version store out of memory error

Hoping someone may be able to advise what might be happening here. I am attempting to run an SSDT deployment via a Powershell script directly on the SQL Server its-self. SQL Version: 2012 (upgrade ...
1 vote
1 answer
425 views

sqlpackage breaks when trying to alter a FILESTREAM column

I have a SQL Database project, where I have recently amended a FILESTREAM column to allow nulls. I am trying to publish the project's dacpac to a db where the column already exists, as a filestream ...
  • 1,131
1 vote
1 answer
1k views

Can't deploy DacPac on Azure DevOps CD

I am building DacPac file from a database project using Visual Studio. Also, in the Debug Drop tab in Advanced Build Settings, I enabled the following options: Do not drop credentials Do not drop ...
1 vote
1 answer
4k views

Error SQL72018: Database Options could not be imported

I am deploying an MVC Project along with a database using Octopus. When the step for deploying the database is hit I'm getting the following error: An error occurred during deployment plan generation....
  • 231
1 vote
3 answers
3k views

SQL Server ScriptDom Parsing

The team of developers I work with are using SQL Data Projects for a large piece of work we have to do against an existing database. We are a few weeks in and there have been a few gotchas, but the ...
1 vote
1 answer
929 views

SSDT/SqlPackage drops statistics

During build we generate dacpac files of our database based on a SSDT .sqlproject. This dacpac later gets deployed to production using sqlpackage. Despite using the /p:DropStatisticsNotInSource=False ...
1 vote
1 answer
523 views

How to deploy dacpac file from a nuget package in c#

I have a nuget package containing my SQL database project. How can I reference the dacpac file in the package in order to deploy it to my azure sql server? I would like to do this from my ASP.net core ...
1 vote
1 answer
1k views

How not to include sql file content when publishing?

I have a question that is very similar to an older question of mine Using variable in sql postdeployment build script? But now I don´t want to do an if/else and have the sql code in my published ...
  • 3,356
0 votes
1 answer
299 views

How do I exclude database triggers from a DACPAC project created in Visual Studio?

I have a database project in Visual Studio, and I need to exclude the database triggers from the generated DACPAC, because one of them is LockdownTriggers which prevents triggers from being altered - ...
  • 6,000
0 votes
1 answer
486 views

How do I reach out to a DACPAC project references through DAC api?

I'm trying to use GetObject method to obtain an instance of a TSqlObject representing a table from a referenced project: var id = new ObjectIdentifier(new[] {"ExternalDb"}, new[] {"Schema", "...
  • 10.1k
0 votes
1 answer
282 views

Publishing DacPacs in Visual Studio 2013

I have an SSDT database project in Visual Studio 2013. This is used as the "answer sheet" when publishing database updates to a database in the other environments. I recently came across Jamie ...
  • 469
0 votes
1 answer
98 views

.Net MVC deploy a dacpac

I'm trying to do deploy dacpac. I'm having errors though when running below code. var dacpacName = "Setup.dacpac"; var dacpacPath = Path.Combine(Server.MapPath("~/assets/...