Skip to content

Latest commit

 

History

History
248 lines (170 loc) · 11.8 KB

File metadata and controls

248 lines (170 loc) · 11.8 KB
title Download and install SqlPackage
description Download and Install SqlPackage for Windows, macOS, or Linux
author dzsquared
ms.author drskwier
ms.reviewer maghan
ms.date 2/27/2024
ms.service sql
ms.subservice tools-other
ms.topic conceptual
ms.custom
tools|sos
intro-installation

Download and install SqlPackage

SqlPackage runs on Windows, macOS, and Linux, and is available to install through dotnet tool or as a standalone zip download.

  • Version number: 162.2.111
  • Build number: 162.2.111.2
  • Release date: February 27, 2024

For details about the latest release, see the release notes.

Note

SqlPackage version numbering has been adjusted to better reflect the DacFx build number it is associated with. Previously, SqlPackage had a distinct version number (19) and build number (160.x). Beginning with version 161, the version number of SqlPackage will match the DacFx version number it is associated with (eg 162.0.52).

Installation, cross-platform

Installing SqlPackage as a dotnet tool requires the .NET SDK to be installed on your machine. Installing SqlPackage as a global tool makes it available on your path as sqlpackage and is the recommended method to install SqlPackage for Windows, macOS, and Linux. SqlPackage is available as a dotnet tool for .NET 6 and .NET 8.

To install SqlPackage as a global .NET tool, run the following command:

dotnet tool install -g microsoft.sqlpackage

More information on the options available with the dotnet tool install command can be found in the dotnet tool install documentation.

To update SqlPackage to the latest version, run the following command:

dotnet tool update -g microsoft.sqlpackage

To uninstall SqlPackage, run the following command:

dotnet tool uninstall -g microsoft.sqlpackage

Preview releases

Preview releases of SqlPackage are available with the dotnet tool feed. To access preview releases, use the --prerelease option with the dotnet tool command. For example, to install the latest preview release, run the following command:

dotnet tool install -g --prerelease microsoft.sqlpackage

To update SqlPackage to the latest preview version, run the following command:

dotnet tool update -g --prerelease microsoft.sqlpackage

A list of preview releases is available on the dotnet tool feed for SqlPackage.

Installation, file download (alternative)

SqlPackage is also prepared as a self-contained download for Windows, macOS, and Linux. No .NET install is required, however, the dependencies included in this .zip download are updated more frequently in the dotnet tool option for SqlPackage. The following links are for the latest version of SqlPackage:

Platform Download
Windows .NET 6 .zip file
Windows .msi file
macOS .NET 6 .zip file
Linux .NET 6 .zip file

Linux

  1. Download SqlPackage for Linux

  2. Extract the file and launch SqlPackage, open a new Terminal window and type the following commands:

    cd ~
    mkdir sqlpackage
    unzip ~/Downloads/sqlpackage-linux-<version string>.zip -d ~/sqlpackage 
    echo "export PATH=\"\$PATH:$HOME/sqlpackage\"" >> ~/.bashrc
    chmod a+x ~/sqlpackage/sqlpackage
    source ~/.bashrc
    sqlpackage

    [!NOTE] You may have missing dependencies. Use the following commands to install these dependencies depending on your version of Linux:

    Debian:

    sudo apt-get install libunwind8

    Red Hat:

    yum install libunwind
    yum install libicu

    Ubuntu:

    sudo apt-get install libunwind8

macOS

  1. Download SqlPackage for macOS

  2. Extract the file and launch SqlPackage, open a new Terminal window and type the following commands:

    mkdir sqlpackage
    unzip ~/Downloads/sqlpackage-osx-<version string>.zip -d ~/sqlpackage
    chmod +x ~/sqlpackage/sqlpackage
    echo 'export PATH="$PATH:~/sqlpackage"' >> ~/.bash_profile
    source ~/.bash_profile
    sqlpackage

    [!NOTE] Security settings may require modification to run SqlPackage on macOS. Use the following commands to interact with Gatekeeper from the command line.

    Before executing SqlPackage:

    sudo spctl --master-disable

    After executing SqlPackage:

    sudo spctl --master-enable

Windows (.NET 6)

  1. Download SqlPackage for Windows

  2. Extract the file by right-clicking on the file in Windows Explorer, and selecting 'Extract All...', and select the target directory

  3. Open a new Terminal window and cd to the location where SqlPackage was extracted:

    > sqlpackage

Windows (.NET Framework)

This release of SqlPackage includes a standard Windows installer experience, and a .zip:

  1. Download and run the DacFramework.msi installer for Windows
  2. Open a new Command Prompt window, and run SqlPackage
    • SqlPackage is installed to the C:\Program Files\Microsoft SQL Server\160\DAC\bin folder

Uninstall SqlPackage

If you installed SqlPackage using the Windows installer, then uninstall the same way you remove any Windows application.

If you installed SqlPackage with a .zip or other archive, then delete the files.

Automated environments

Evergreen links are available for downloading the latest Sqlpackage versions:

DacFx

SqlPackage is a command-line interface for the DacFx framework, exposing some of the public DacFx APIs. DacServices (Microsoft.SqlServer.Dac) is a related mechanism for integrating database deployment into your application pipeline. The DacServices API is available in a package through NuGet, Microsoft.SqlServer.DacFx. The current DacFx version is 162.1.172.1.

Adding the NuGet package to a .NET project is accomplished via the .NET CLI with this command:

dotnet add package Microsoft.SqlServer.DacFx

Note

Additional NuGet packages were published under the DacFx name, "Microsoft.SqlServer.DacFx.x64" and "Microsoft.SqlServer.DacFx.x86". Support for both platforms is covered under the "Microsoft.SqlServer.DacFx" package. New references should be made to this package, not the x64 or x86 variants.

Supported Operating Systems

SqlPackage runs on Windows, macOS, and Linux and is built using .NET 6. The .NET 6 OS requirements are minimum requirements for SqlPackage, which has extra requirements due to its dependencies.

Windows (x64)

  • Windows 11
  • Windows 10 (1607+)
  • Windows 8.1
  • Windows 7 SP1
  • Windows Server Core
  • Windows Server 2012 R2
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022

macOS

  • macOS 14 "Sonoma"
  • macOS 13 "Ventura"
  • macOS 12 "Monterey"
  • macOS 11 "Big Sur"

Linux (x64)

  • Debian 10, 11
  • Red Hat Enterprise Linux 7+
  • SUSE Linux Enterprise Server v12 SP2+
  • Ubuntu 16.04, 18.04, 20.04, 22.04

Available Languages

This release of SqlPackage can be installed in the following languages:

SqlPackage .NET 8 Windows:
Chinese (Simplified) | Chinese (Traditional) | English (United States) | French | German | Italian | Japanese | Korean | Portuguese (Brazil) | Russian | Spanish

SqlPackage .NET Framework Windows:
Chinese (Simplified) | Chinese (Traditional) | English (United States) | French | German | Italian | Japanese | Korean | Portuguese (Brazil) | Russian | Spanish

SqlPackage .NET 8 macOS:
Chinese (Simplified) | Chinese (Traditional) | English (United States) | French | German | Italian | Japanese | Korean | Portuguese (Brazil) | Russian | Spanish

SqlPackage .NET 8 Linux:
Chinese (Simplified) | Chinese (Traditional) | English (United States) | French | German | Italian | Japanese | Korean | Portuguese (Brazil) | Russian | Spanish

Next Steps

Microsoft Privacy Statement