Where is SQLPackage?
What is SqlPackage?
SqlPackage.exe is a command-line utility that automates the following database development tasks:
The SqlPackage.exe command line tool allows you to specify these actions along with action-specific parameters and properties.
- Version: Returns the build number of the SqlPackage application. Added in version 18.6.
- Extract: Creates a data-tier application (.dacpac) file containing the schema or schema and user data from a connected 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 creates it. Otherwise, an existing database is updated.
- Export: Exports a connected SQL database - including database schema and user data - to a BACPAC file (.bacpac).
- Import: Imports the schema and table data from a BACPAC file into a new user database.
- 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.
Download the latest version. For details about the latest release, see the release notes.
If you have Visual Studio, SQL Server of SQL Server Management Studio installed - you may already have SqlPackage installed on your machine.
Common locations to find SqlPackage.exe:
- Visual Studio
- C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC
- C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150
- C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150
- SQL Server:
- C:\Program Files\Microsoft SQL Server\150\DAC\bin\
At work we use SqlPackage extensively to deploy all our databases. We have recently added a DeploymentPlanModifier extension to document what is being changed for each release in a more human friendly manner (we chose markdown which is then also rendered as html) for consumption by other teams that need to know what changes are being made. I will post about that in a future post.