Last modified on 10th September 2018

DACPAC deployment using command line

You must have SqlPackage.exe installed. This is usually installed in:

C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe

The “140” in the path above refers to the version of SQL installed. In our example, this is indicating version 14.0 (SQL 2017). Yours may be different if you have a different version installed.

The command to deploy DACPAC using SqlPackage.exe will be:

cd "C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\"
SqlPackage.exe /Action:Publish /SourceFile:C:\Temp\SQLWATCH.dacpac /TargetDatabaseName:SQLWATCH /TargetServerName:YOURSQLSERVER /p:RegisterDataTierApplication=True