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

Prepending a timestamp to each line of output from a command or executable

I want to prepend a timestamp to each line of output from a command. For example: foo bar baz would become: [2011-12-13 12:20:38] foo [2011-12-13 12:21:32] bar [2011-12-13 12:22:20] baz where the time being prefixed is the time at which the line…
runamuk0
  • 784
  • 1
  • 7
  • 20
4
votes
2 answers

Latest SSDT vs. SqlPackage incompatibility for SQL Server 2014

One of our build servers has just been updated to the latest "Microsoft SQL Server Update for database tooling" (version 12.0.60629.0) and is now incompatible with the version of SqlPackage.exe we have (in C:\Program Files (x86)\Microsoft Visual…
Nick Jones
  • 4,395
  • 6
  • 33
  • 44
4
votes
2 answers

Generate Smart Defaults, when Applicable, using SQL Management Studio

I am currently working on a project to publish our database as a data tier application. The database is fairly complex and has required several parameters to be modified when either using SQLPackage.exe or publishing via Visual Studio. One of the…
Slavvy
  • 551
  • 7
  • 13
3
votes
1 answer

How to import a bacpac to Azure without rebuilding the indexes

I'm using sqlpackage to import .bacpac to Azure Databases but once the datas have been imported it starts enabling back the indexes and it takes forever. I would like to skip this part. I though it was bound to the following parameter : /p:…
Maxime
  • 818
  • 6
  • 24
3
votes
1 answer

DacFx and Custom DeploymentContributor (AgileSqlClub.DeploymentFilterContributor)

I've tried at least a dozen or so ways to get the module to load and work but still get the same error:  Error SQL0: Required contributor with id 'AgileSqlClub.DeploymentFilterContributor' could not be loaded. I've tried to run it with…
3
votes
1 answer

sqlpackage publish action permissions issue

I'm running the below sqlpackage command against my sqlserver: sqlpackage /action:Publish /SourceFile:"Database Services\bin\Release\Database Services.dacpac" /TargetConnectionString:"Data Source=${Env};Integrated Security=True;Persist Security…
arielma
  • 1,308
  • 1
  • 11
  • 29
3
votes
1 answer

Deploy DACPAC with SqlPackage from Azure Pipeline is ignoring arguments and dropping users

I have a release pipeline in Azure where I pass a .dacpac artifact (created with VStudio) to be deployed in an on-prem Sql Server 2016. It works good, but now I want to drop tables, views, functions and stored procedures on my server via .dacpac. So…
dtc
  • 155
  • 1
  • 7
3
votes
2 answers

Dry-run DACPAC with sqlpackage

Is it possible to execute a "dry-run" using sqlpackage.exe on a DACPAC? The reason I am asking is that we have an internal process with automates and tracks all changes to the database but also an external process that does manual releases. What I…
andyb952
  • 1,931
  • 11
  • 25
3
votes
1 answer

Publishing a database project with Always On Encryption and Azure Key Vault

I have an existing SQLAzure database. We are developing a new feature and need to have column level encryption. I am researching how to set this up. We currently push changes to our local and to production via a database project. A simple right…
3
votes
1 answer

SSDT Project publish transactional deployment

I am using SQLPackage.exe utility together with Database project's publish profiles to run changes to the SQL Server database. From my understanding, this is the deployment process: Pre-Deployment Script Main Deployment Post-Deployment Script I…
3
votes
2 answers

SqlPackage - How do I stop it from turning off my query store?

I have a database project in Visual Studio 2017. Our database project is managed just like any other library of code where multiple developers can update the project as necessary. To ease the pain of deployments, I have built a custom deployment…
3
votes
1 answer

Automatically create database compare scripts and execute

I have a situation where I have to compare my database version (schema) with all my clients (possibly different versions) and deploy necessary changes to make all versions alike. I'm looking for a way that automatically compares my database schema…
Harshit Gindra
  • 355
  • 3
  • 7
3
votes
1 answer

How to test if DACPAC can be deployed without actual deployment

Is it possible to test a DACPAC against the DB without deploying it? sqlpackage.exe with Action=Deploy will deploy it if no errors are found and Action=Report will just generate a report with the list of changes but deployment can still fail.
Artur Shamsutdinov
  • 3,127
  • 3
  • 21
  • 39
3
votes
1 answer

SqlPackage.exe command throwing errors after upgrade

We use PowerShell scripts to deploy SQL database. This scripts are using SqlPackage.exe utility to publish our main database, it was working fine until we upgraded SSDT to it's latest release SSDT 2015 when it stated to throw the error…
3
votes
0 answers

SQL Server Data Tools - SQLPackage Extract throws error in presence of symmetric keys

We're trying to use SQLPackage.exe to create a database extract 'dacpac' file to be used in the context of a studio based SQL server project. Our goal is to be able to use SQL Server Data Tools to manage our database schema in source control and to…
Brett Green
  • 3,535
  • 1
  • 22
  • 29
1 2
3
13 14