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

Prevent SqlPackage from writing to primary partition during Export

To move a 144GB SQL Server database to Azure SQL I want to export it to the .bacpac format. To do so I use SQL Package of SQL Version 130: C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin>SqlPackage.exe /Action:Export /ssn:MY_MSSQL_INSTANCE…
Gabriël
  • 1,323
  • 2
  • 22
  • 34
0
votes
1 answer

Upload SQL Database from Azure Blob Azure to Sql Database

I want to transfer .bacpac database from Azure Blob Storage to Azure SQL Database. I am using sqlpackage.exe using import command as sqlpackage.exe /a:Import /sf:< Azure Blob .bacpac file > /tsn:< Azure Server Name > /tdn:< target databse name >…
0
votes
1 answer

Cannot extract Azure Sql Server database after enabling database auditing and threat detection

After enabling auditing and threat detection in Azure for my Sql Server database, I can no longer extract my database dacpac using sqlPackage.exe as I'm presented with this error: The element ##MS_DatabaseMasterKey## is not supported in Microsoft…
dhughes
  • 645
  • 1
  • 7
  • 19
0
votes
2 answers

Getting "Can not access a closed Stream" error message when trying to extract a database using sqlpackage.exe with powershell

So I have an automation tool that uses c# to invoke a Powershell script that will use sqlpackage.exe to extract a database on a remote server into a .dacpac and save it into my file system. We use asynchronous calls to the powershell…
Josh L
  • 1,412
  • 2
  • 18
  • 40
0
votes
1 answer

NT AUTHORITY\Local account Issue with SQLPackage.exe on Windows 7

We have been using SQLPackage.exe file from installer to deploy LocalDB V11.0 on various OS. While this is working fine for Windows 8.1 and Window 2012 R2, we keep getting below error when we tried from Windows7. Error SQL72014: .Net SqlClient Data…
Deep Vyas
  • 35
  • 4
0
votes
1 answer

How to Overwrite Database Table Data Using SQL Server Data Tools

I'm currently working on a small project using sql data tools. I'm getting data from excel sheet and write it back to my database table. from the database table I'm generating a report. Time to time I'm updating my excel sheet. but it won't update…
0
votes
1 answer

ANSI_PADDING in a DACPAC

When creating a DACPAC using SQLServer's sqlpackage.exe (from SQL Server 2014), so far I haven't seen ANSI_PADDING mentioned. And in some rare cases this is a problem as the database I'm working on seems to have a couple of fields where ANSI_PADDING…
0
votes
1 answer

How to Auto-populate SQLCMD variable with Build/Assembly Version

Using Visual Studio 2013 with TFS and SQL Server 2012 & 2014, and SQLPackage.exe with a Publish profile. Does anyone know if/how to get the Build version or Assembly version into a SQLCMD variable? i.e. I'm trying to obtain whatever system-level…
Simon Wray
  • 192
  • 4
  • 12
0
votes
0 answers

SqlPackage.exe is throwing an error that's breaking my deployment script

What does this error message mean? error MSB3073? 1>D:\BuildAgent\work\db3238a9996f31f9\DeployToEnvironment.proj(165,3): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe"…
nullException
  • 1,112
  • 4
  • 17
  • 29
0
votes
1 answer

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 Thompson's blog article on DacPacs, where he writes a…
0
votes
2 answers

sqlpackage.exe - how do I exclude synonyms>

I'm running sqlpackage.exe as park of an automated deployment script creation process, however we have synonyms in the database, which are different depending on the environment (Dev/Test/Live). The problem is that the database project has the…
Matt Eno
  • 687
  • 5
  • 25
0
votes
1 answer

Invalid object name error: DACPAC Deployment using SQLPackage.EXE

I’m facing an issue when deploying a DACPAC to a SQL server (SQL 2014 – 12.0.2430). Here’s the error I’m getting: invalid object name dbo.usp_SomeStoredProcedure_Update. This happens if I’m altering a stored procedure. Though, the DB project gets…
Ranbeer M
  • 131
  • 7
0
votes
2 answers

SSDT - Build Deployment Script without dacpac

I've got a question about building a deployment script using SSDT. Could anyone tell me if it's possible to build a deployment script using SQLPackage.exe where the source file is NOT a dacpac file, but uses the .sql files instead? To give some…
-1
votes
1 answer

Azure DevOps - Multitenant database deployment

We have Web application with one code and multitenant database behind and we are using Azure Devops CI/CD for code deployment. We are able to release the code to database perfectly, however we want to deploy it to multiple database without multiple…
-1
votes
1 answer

Which tool can I use to encrypt bacpac file using azure key vault

I exported my azure SQL Managed instance to a Bacpac file using SQLPackage, Now I want to store it on a azure file storage. Before I want to copy the bacpac to the file storage, I want to encrypt it using a Secret from Azure key vault. SQLPackage…
1 2 3
13
14