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

SQLPackage Post Deployment Script not running

I'm using Visual Studio 2013 with TFS, over SQL-Server 2012. Specifically I'm using SQL-Server Data Tools within VS for our SQL development, rather than within SQL-Server Management Studio. In short, the Post-Deployment SQL script appears not to be…
Simon Wray
  • 192
  • 4
  • 12
1
vote
1 answer

Post deployment parameters in DacPac

I'm creating a DacPac in TeamCity by building a sql project. The resulting DacPac has a post deployment script that I would like to update either on deployment or before it is created with a version number. Is it possible to set this parameter…
Adamon
  • 484
  • 9
  • 21
1
vote
1 answer

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 column, but is currently NOT NULL. I am performing…
Simon Green
  • 1,131
  • 1
  • 10
  • 28
1
vote
1 answer

PowerShell command not executed?

In the following PowerShell v2.0 script, the command & is not executed : $SqlPackageExe = "C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\sqlpackage.exe" Write-Host "Before SqlPackage" & "$SqlPackageExe" /Action:Publish…
Phil
  • 1,035
  • 2
  • 10
  • 17
1
vote
0 answers

SQLPackage - Comparing between two dacpacs always contains objects related to linked server

first I'm sory for my broken English. I have two different databases in two different SQL instances, and both instances have references to each other by linked server. I have added this references in the database solution and use a variable to…
1
vote
1 answer

Why is my database project upgrade script including refactoring from referenced database projects?

Hopefully this will make some sense .. We have a bunch of database projects that we use to maintain schema and generate upgrade scripts. To generate the upgrade scripts, we use an automated build engine which uses SqlPackage.exe to compare the…
Matt Winward
  • 1,255
  • 2
  • 15
  • 43
1
vote
1 answer

log sqlpackage.exe error in file

I am using SQlPackage.exe to deploy / publish the database project. i want to log the publishing activity like creating database / table or any modification in a separate log file. but it seems that there is no option in sqlpackage.exe to log this…
1
vote
1 answer

Error when calling SQLPackage 'publish' with TargetDatabaseName or tdn argument

As the SQLPackage manual here when calling publish action, we have the argument TargetDatabaseName or tdn (in section Target Parameters) But when adding this parameter to SQLPackage call, I got the error saying that the argument is not…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
0
votes
0 answers

SQL71502 SQL Procedure : has an unresolved reference to object [dbo].[sp_executesql]

I have a stored procedure in a SQL Project running in JetBrains Rider which is defined as follows: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[spGetDeviceNotification] @SerialNumber NVARCHAR(60), @ChannelID…
0
votes
0 answers

How to import .bak file to Azure SQL Server: Error during import using SQLPackage.exe

I am trying to migrate a SQL Server database from my on-premises server to an Azure SQL Server. I'm attempting to do this using the command line. I have taken help from few guides also like…
0
votes
0 answers

SqlPackage.exe - External Table Dropping / Recreating even if there are no changes

Am using Sqlpackage.exe for to deploy my latest .dacpac into the SynapseSql using this command: sqlpackage /Action:Publish /SourceFile:test.dacpac /p:DropObjectsNotInSource=TRUE…
R. Maier
  • 340
  • 2
  • 13
0
votes
2 answers

Sqlpackage.exe stucks on initialization

Am using sqlpackage.exe for synapse deployment, version 162.0.52.1. During the initialization, it stucks at this step: Does anybody know, how to solve it?
R. Maier
  • 340
  • 2
  • 13
0
votes
1 answer

DACPAC Deployment through powershell script is failing with timeout error

We have created powershell script to deploy our dacpac packages. This script uses Microsoft.SqlServer.Dac.dll library. When I am deploying my dacpac using this powershell script, I am getting following Bug: .Net SqlClient Data Provider: Msg -2,…
0
votes
1 answer

How to locate Sqlpackage tool after global installation in Docker container?

I'm attempting (relatively inexperienced) to write a Dockerfile that publishes a dacpac to a linux container before firing up sqlserver, but building the Dockerfile always results in the following: /bin/sh: 1: /home/mssql/localtools/sqlpackage: not…
Dean_Akin
  • 1
  • 1
0
votes
1 answer

mass import FOREIGN KEY same table

I have scripted data from a database and want to import them to another, however, I'm getting a FOREIGN KEY SAME TABLE error. After looking at the data I've noticed that FK the row is expecting is created couple of insert statements below. Is there…
Branislav B.
  • 509
  • 7
  • 21