Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 2.19 KB

File metadata and controls

50 lines (36 loc) · 2.19 KB
title Build a Project from the Command Line
description Build a SQL Server Database Project from the command line
author dzsquared
ms.author drskwier
ms.reviewer randolphwest, maghan
ms.date 10/10/2025
ms.service sql
ms.subservice sql-database-projects
ms.topic how-to
ms.collection
data-tools

Build a database project from command line

[!INCLUDE azure-data-studio-deprecation]

While the SQL Database Project extension provides a graphical user interface to build SQL database projects, a command line build experience is also available for Windows, macOS, and Linux environments. This article outlines the prerequisites and syntax needed to build a .dacpac from a Microsoft.Build.Sql SDK-style SQL project at the command line.

Microsoft.Build.Sql with .NET

Using Microsoft.Build.Sql with SDK-style SQL projects is the preferred method for working with SQL projects from the command line.

To build an SDK-style SQL project from the command line on Windows, macOS, or Linux, use the following command:

dotnet build

Optionally, you can specify the project name. Specifying the project name enables building a specific project within a more complex folder structure.

dotnet build AdventureWorks/AdventureWorks.sqlproj

Microsoft.Build.Sql with .NET Framework

Starting with Microsoft.Build.Sql 2.0.0-preview.3, SDK-style SQL projects can be built from the command line with .NET Framework and msbuild. For SQLCLR objects, .NET Framework is required to build the SQL project.

msbuild AdventureWorks/AdventureWorks.sqlproj

Related content