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

Could not deploy package. Unable to connect to master or target server. You must have a user with the same password in master or target server

I am using self Hosted Agent (Windows 2019) with SQL Server 2019 in Azure DevOps. I am using "SQL Server database deploy" Task. And trying to deploy a dacpac with the database project created using VS2019. I am getting an error as "Could not deploy…
VKD
  • 633
  • 2
  • 12
  • 28
0
votes
1 answer

How to pass SQLCMD variables du MSBuild during Build?

I am referencing a database project during publish in a second database project. For easier reference, let's call them Database and Database.Tests. Database is being referenced by Database.Tests During deployment the Database project will be…
Marco
  • 22,856
  • 9
  • 75
  • 124
0
votes
1 answer

SqlPackage import maximum db size

I want to import a database from a .bacpac file to a SQL Server in Azure. I read the document here: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-import?view=sql-server-ver15 It says that there is a flag called…
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
0
votes
0 answers

Sqlpackage.exe not recognized

i am trying to run command SqlPackage.exe /Action:Publish /SourceFile:"MyProject.BI.Database.MyDb.dacpac" /Profile:"Local.MyProject.BI.Database.MyDb.publish.xml" 1> Local.MyProject.BI.Database.MyDb.log 2>&1 But i get error SqlPackage is not…
DevelopmentIsMyPassion
  • 3,541
  • 4
  • 34
  • 60
0
votes
1 answer

SQL Server SqlPackage variables: are quotes needed around string variable?

When running sqlpackage.exe for deployments, do string variables require quotes around the word? It seems to be running successfully both ways. What is the correct syntax? Two options shown here: /v:CompanyName=ABCD /v:CompanyName="ABCD" Resource:…
user15027693
0
votes
1 answer

SQL Server Schema and data comparison using SSDT

I'm trying to do data comparison and automate database upgrade script generation by using SQL Server Database tools > SchemaComparison/DataComparison. Using VS command window, I am able to run > Tools.NewDataComparison [args...] >…
0
votes
1 answer

@@SERVERNAME when using sqlpackage.exe in multi instance environment

We are using sqlpackage.exe to deploy a database. In the deploy process, we have a script that creates a loopback linked server: EXEC master.dbo.sp_addlinkedserver @server = N'loopback' ,@srvproduct=N'' ,@provider=N'SQLNCLI' …
Arklur
  • 173
  • 1
  • 11
0
votes
0 answers

SQL Server SQLPackage Drift Report doesn't work on SQL Server 2017

I'm trying to run a Drift Report from SQL Server 2017 (RTM). Running into the following issue... > sqlpackage /a:DriftReport /tcs:"Data Source=DAYPOCSQLAS01;Trusted_Connection=true;Database=ChuckD" /op:drift.txt Generating drift report for…
dascalos
  • 509
  • 4
  • 14
0
votes
1 answer

SQLPackage Error when trying to release my pipeline

I have installed an Agent pool in my Azure VM. I am trying to deploy a dacpac file using the agen pool but I get the error No agent found in pool which satisfies the specified demands: sqlpackage, Agent.Version -gtVersion 1.103.0 I have installed…
weewoo
  • 135
  • 1
  • 5
  • 10
0
votes
0 answers

Upgrade SqlPackage rebuilds whole database because of UTF-8 support

In 2019, Microsoft added UTF-8 for SQL Server: https://techcommunity.microsoft.com/t5/sql-server/introducing-utf-8-support-for-sql-server/ba-p/734928 Previously dropped characters are suddenly supported. But UTF-8 takes more space. Deploying the new…
Wouter
  • 154
  • 17
0
votes
1 answer

SSIS Job , passing the value in job steps

I have a SSIS job with multiple steps, each steps is from different package or project. When I execute the job , I write log in db with a guid, but each guid is created in its package or project. I need to update the same value for all the steps ,…
TD2013
  • 97
  • 1
  • 3
  • 13
0
votes
1 answer

Using the Dart/Flutter Postgres Package to store dates and null dates needs two separate commands

I am using the Postgres Package (On the pub.dev site) to UPDATE records in a very simple database. It has two fields: a Text field prime key named number, and a Date field named date_of_birth. If the date_of_birth is a valid DateTime string then all…
Paul Pritchard
  • 614
  • 2
  • 11
  • 23
0
votes
0 answers

Ignore RefactorLog files while publishing SQL server database

How could I exclude .RefactorLog file while publishing SQL Server databases by SQLPackage.exe? Actually I never mind these files at all but they potentially could execute unexpected scripts during database publish. I know that removing them or…
0
votes
1 answer

DACPAC - How to deploy one particular schema

I've been looking to find ways to deploy one particular schema (Schema B) from database (Schema A, Schema B, Schema c..) using dacpac and sqlpackage.exe. I found this similar question but looks like the links on it have been archived. also found…
Prany
  • 2,078
  • 2
  • 13
  • 31
0
votes
0 answers

RuntimeError: Package installation failed, installed dependencies were rolled back

I was planning to execute python scripts in Sql Server Management Studio but first I have to install some missing library/packages first so the script can properly run. I was using sqlmlutils to install these python packages in SQL Server but there…
anhnguyen
  • 19
  • 1
  • 4