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
1
vote
1 answer

Extracting a DACPAC from the master Database

I'm working on bringing an existing Azure V12 database into an SSDT project so we can start using source control and CI pipelines. The problem I'm struggling with is that there is a reference to "sys.fn_get_audit_file" in some of the code and it…
Serital
  • 343
  • 3
  • 13
1
vote
0 answers

Sequencing Release pipelines based on dependencies

We have implemented DevOps for our, SQLServer based, database releases on Azure DevOps using MSBuild (to create the dacpac in the build pipeline) and sqlpackage.exe (for deploying the dacpacs). The build pipeline results in two dacpacs (one for…
Gopinath Rajee
  • 400
  • 5
  • 20
1
vote
1 answer

VSTS - SQL Server Database Deploy - DoNotDropObjectTypes not a valid argument

I'm attempting to use the SQL Server Database Deploy release task to deploy my dacpac and I would like to use the /p:DoNotDropObjectTypes=Users;Permissions argument to prevent certain objects from being dropped, however I'm getting the following…
Joe Eng
  • 1,072
  • 2
  • 15
  • 30
1
vote
0 answers

SqlPackage.exe - Export Azure Db to blob storage

Can you use sqlpackage.exe to trigger an export database to BLOB storage? Surprisingly enough I cannot find any reference to doing this. The parameters for "sqlpackage /a:export" do not have any parameters that specify blob storage, just…
KickinMhl
  • 1,218
  • 3
  • 14
  • 32
1
vote
2 answers

Unable to publish DACPAC to Azure SQL Database using sqlpackage.exe

When trying to apply a DACPAC to an Azure SQL Database I'm getting the following from sqlpackage.exe: *** An error occurred during deployment plan generation. Deployment cannot continue. The Element or Annotation class SqlDatabaseOptions does not…
1
vote
0 answers

Could not load package from "...\sql\debug\database.bacpac"

I have built my database project for SQL Server 2012. And I am using following command to prepare deployment script, "C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /Action:Script /TargetDatabaseName:DacPacTest1…
JackLock
  • 1,168
  • 1
  • 13
  • 26
1
vote
0 answers

How do I escape an equals character in a AdditionalDeploymentContributorArguments property passed to sqlpackage.exe?

sqlpackage is a command in SQL Server used with DACPACs. It can take an argument of the form /p:AdditionalDeploymentContributorArguments=... where ... is a semi-colon delimited list of key-value like this key1=value1;key2=value2. I would like to…
Chry Cheng
  • 3,378
  • 5
  • 47
  • 79
1
vote
1 answer

Build and generate script for SSDT project using command line tools

I am trying to achieve following workflow using command line: Build the project using specific variables overriding via command line (for example I have $(buildVersion) variable in publish config that has some value. I would like to override the…
Dmitrij Kultasev
  • 5,447
  • 5
  • 44
  • 88
1
vote
3 answers

Deploying SQL Changes Containing $(ESCAPE_SQUOTE())

I have a Database project in Visual Studio that I am attempting to deploy automatically to a test environment nightly. To accomplish this I am using TFS which leverages a PowerShell script to run "SqlPackage.exe" to deploy any changes that have…
David Rogers
  • 2,601
  • 4
  • 39
  • 84
1
vote
1 answer

Getting SqlServer Dac assembly file path on target machine when using DacServices to deploy

I'm invoking DacServices APIs to deploy DACPACs, which requires an assembly reference of Microsoft.SqlServer.Dac. The target machine on which i run my installer could have SSDT/SQL installed on D drive or maybe a higher version of SQLServer could be…
ajeesh k
  • 93
  • 8
1
vote
1 answer

Why do SqlPackage Script Action and VisualStudio Generate Script produce different results?

We have a Visual Studio database project with a publish profile that produces different change scripts depending on whether I use Visual Studio's Generate Script option or SQL Package from the command-line: Visual Studio creates a 10,455KB…
flipdoubt
  • 13,897
  • 15
  • 64
  • 96
1
vote
1 answer

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 switch, sqlpackage will drop all statistics, that…
1
vote
1 answer

Running sqlpackage.exe from AWS CodeDeploy throws an exception

I'm attempting to run sqlpackage.exe from a script executed by AWS CodeDeploy. The sqlpackage command runs fine from a local CMD prompt when logged in as the administrator but does not run when called as part of the CodeDeploy pipeline. The…
Remotec
  • 10,304
  • 25
  • 105
  • 147
1
vote
1 answer

Ignore Dacpac Snapshot options during publish

Is it possible to ignore the snapshot options set in a given database project's project settings, when deploying its dacpac (either through sqlpackage.exe, DacFx or Visual Studio)?
Simon Green
  • 1,131
  • 1
  • 10
  • 28
1
vote
2 answers

Passing a variable in sqlpackage containing filepath

so i am trying to exectue a ps script directly after tfs build. while the script runs post-build there is an error that says sourcefile must have a valid .dacpac extension. Below is the code #Powershell script to capture the latest version of the…