Questions tagged [sqlpackage]

A command line utility for automating SSDT database deployment tasks.

SqlPackage.exe is a command line utility that automates the following database development tasks:

  • Extract: Creates a database snapshot (.dacpac) file from a live SQL Server or Windows Azure SQL Database.

  • Export: Exports a live database - including database schema and user data - from SQL Server or Windows Azure SQL Database to a BACPAC package (.bacpac file).

  • Import: Imports the schema and table data from a BACPAC package into a new user database in an instance of SQL Server or Windows Azure SQL Database.

  • Publish: Incrementally updates a database schema to match the schema of a source .dacpac file. If the database does not exist on the server, the publish operation will create it. Otherwise, an existing database will be updated.

  • DeployReport: Creates an XML report of the changes that would be made by a publish action.

  • DriftReport: Creates an XML report of the changes that have been made to a registered database since it was last registered.

  • Script: Creates a Transact-SQL incremental update script that updates the schema of a target to match the schema of a source.

The SqlPackage.exe command line allows you to specify these actions along with action specific parameters and properties.

196 questions
0
votes
0 answers

Azure Devops Server - Deploy database updates under a specific domain account

In an on-prem/self-hosted azure pipelines release task, I want to deploy database updates via sqlpackage.exe to sql server. I am currently doing this with a command line task. The admins require a connection to sql server with a trusted domain…
0
votes
1 answer

SSDT generate and publish database changes

I am currently using the following command to generate a database script using SSDT: "C:\Program Files\Microsoft SQL Server\150\DAC\bin\SqlPackage.exe" /Action:Script /sf:DB.dacpac /Profile:publish.xml /op:Script.sql and the following command to…
0
votes
2 answers

How to generate the script of rename table using sqlpackage.exe?

I have Two Database some-db-dev & some-db-qa. Both the databases are identical to each other. I have created a DACPAC File for both the databases. some-db-dev.dacpac and some-db-qa.dacpac respectively.(It had the Table as "A" and Column "Test" in…
0
votes
0 answers

Error SQL0: The reference to external elements from the source named 'master.dacpac' could not be resolved, because no such source is loaded

Despite the fact that: a) my master.dacpac file exists in the same directory as the dacpac I'm attempting to publish b) I've also copied the master.dacpac to the current working directory c) I've added the master database as database reference with…
ChrisAdkin
  • 1,236
  • 1
  • 16
  • 31
0
votes
1 answer

Is there a way to create migration script for a single or a selected group of objects with SqlPackage?

I'm trying to migrate specific objects from one database to another using sqlpackage.exe /action:Extract and sqlpackage.exe /action:Script. Currently I'm creating the script and filtering the unneeded objects manually, I would like to be able to…
Yuval Perelman
  • 4,499
  • 1
  • 22
  • 32
0
votes
1 answer

Invalid object name when publishing: SQLPackage (DACFramework 15) Possible Bug

I've been struggling with this issue for most of the morning and I'm ready to suggest this is a bug in SqlPackage.exe I extract a dacpac using the following command: C:\"Program Files"\"Microsoft SQL Server"\150\DAC\bin\SqlPackage.exe /a:Extract…
Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147
0
votes
1 answer

Need to specify the Microsoft.Data.Tools.Schema.Tasks.Sql version explicitly in a Visual Studio database project

My situation is a bit complex, I hope I can explain it correctly: I have a Visual Studio solution which I'm using to build a WiX installer. This installer, among other things, deploys an SQL DB schema through a dacpac. This dacpac is generated by an…
0
votes
1 answer

Can object creation in a database project (SqlPackager) be conditional?

I have a Microsoft SQL Server database project with hundreds of objects (tables, procedures, etc). The resulting database is used in two contexts though -- some customers get a database with all the objects, but some customers' databases contain…
Frogger
  • 94
  • 8
0
votes
1 answer

SqlPackage.exe - "System.StackOverflowException"

I have a series of PowerShell scripts that are run by a TFS agent are part of a build process. These are run on several servers(Windows Server 2012 R2) that publish a series of DACPAC's to a given set of Databases. Recently I updated all the TFS…
David Rogers
  • 2,601
  • 4
  • 39
  • 84
0
votes
0 answers

Unable to deploy Azure SQL Database

I am trying to deploy Azure SQLDatabase using SQLPackage.exe(DacPack Deploy) via Powershell. While deploying dacpack(130) in region "East US", I get below error: sqlpackage.exe : * Could not deploy package. …
Amruta
  • 701
  • 4
  • 15
  • 38
0
votes
0 answers

SSDT Ignore uses in sqlpackage script

I'm trying to use SSDT to update schema on a target database based on a source database. sqlpackage.exe /a:Script /sf:source.dacpac /tf:target.dacpac /tdn:"MyTargetDB" /op:update.sql /p:ExcludeObjectTypes="Users;RoleMembership" I'm using the…
dhrm
  • 14,335
  • 34
  • 117
  • 183
0
votes
0 answers

DeploymentPlanExecutor.OnExecute not Being Called By SqlPackage.exe

I am trying write a PowerShell script to deploy a DACPAC that requires a specific DeploymentPlanExecutor extension that I have written. The extension implements override methods for both OnApplyDeploymentConfiguration and OnExecute. Everything works…
Bobby
  • 88
  • 5
0
votes
1 answer

Can I use the DeployReport option when deploying a dacpac through Release Management

I'd like to be able to setup a WinRM dacpac deployment task in MS Release Management to create a report of the schema compare and not actually deploy the database. Then I could have an environment approval and abandon the deployment if unexpected…
0
votes
1 answer

Unpacking and building SQL Server 2014 project with VS2012 sqlpackage.exe

I've been trying to test whether a project (DB, SSIS, SSAS) built on SQL Server 2014 will be compatible with SQL Server 2012. I've got a .dproj packed in dacpac format and when I try to run this from cmd: sqlpackage.exe /Action:Script…
0
votes
2 answers

SQLPackage.exe filename with the date

I am trying to automate a backup of an Azure database to my local machine using SQLPackage.exe. I am trying to add the date onto the filename so that every night it doesn't get overwritten. The following line will pick up the date but will then stop…
WillNZ
  • 765
  • 5
  • 13
  • 38