Skip to content

Latest commit

 

History

History
113 lines (88 loc) · 7.44 KB

sql-projects-tools.md

File metadata and controls

113 lines (88 loc) · 7.44 KB
titledescriptionauthorms.authorms.reviewerms.datems.servicems.subservicems.topicms.collection
SQL Projects Tools
This overview reviews the tooling for SQL database projects.
dzsquared
drskwier
randolphwest
02/19/2025
sql
sql-database-projects
overview
data-tools

SQL projects tools

Tooling for SQL projects is available in several development environments and command line interfaces. The primary tools for SQL projects are the SqlPackage command line utility, SQL Server Data Tools (SSDT) in Visual Studio, and the SQL Database Projects extension for Azure Data Studio and Visual Studio Code.

Tools included in this article:

Graphical tools

These tools provide a graphical interface for SQL projects, a T-SQL editor, and a build and publish process.

SQL Server Data Tools (SSDT) is a Visual Studio component that provides a graphical interface for SQL projects. SSDT provides a visual designer for tables, a T-SQL editor, and a build and publish process.

SQL Database Projects extension is an extension for Azure Data Studio (ADS) and VS Code. This extension provides a graphical interface for SQL projects, a T-SQL editor, and a build and publish process.

Feature set comparison

FeatureSDK-style SSDTSSDTADSVS Code
Create new empty projectXXXX
Create new project from existing databaseXXX
Open existing Microsoft.Build.Sql projectsXXX
Solution management and operationsXX
Project run buildXXXX
Publish project to existing serverXXXX
Publish project to a local development instanceX1X1X2X2
Publish options/propertiesXXX
Target platform can be updatedXXXX
SQLCMD variablesXXXX
Project referencesXX
Dacpac referencesXXX
Package referencesX
Publish profile creationXXX
SQL files can be added by placing in project folderXXX
SQL files can be excluded from buildXX
Pre/post deployment scriptsXXXX
New object templatesX3XX3X3
Project files can be organized into foldersXXXX
Schema comparison project to databaseXX
Schema comparison database to projectXX
Graphical table designerXX
Code analysis – enable/disable rulesX
Project properties – build output settingsXX
Project properties – default schemaX
Project properties – database settingsX
Project run code analysis standaloneX
Object renaming and refactoringX
Intellisense provided in database files from project modelX
SQL Server object explorer connectivity/view objectsXXXX
SQL Server object explorer context menu itemsXXX
SQL Server query editor connectivityXXX
  1. Local development instance is a SQL Server LocalDB instance.
  2. Local development instance is a SQL Server container.
  3. Limited subset of templates available

Command line tools

SqlPackage is the primary command line utility for the DacFx library, enabling automation of the database development tasks such as deploying a .dacpac to a database or extracting the objects of a database to a SQL project or .dacpac.

Custom console applications can be built using the DacFx .NET library to automate database development tasks. The Microsoft.SqlServer.Dac namespace contains classes for creating, deploying, and extracting database objects and is foundational to the rest of the DacFx library.

CI/CD pipelines can be built with command line execution or with tasks specific to .dacpac and SQL projects deployment. The GitHub sql-action and SqlAzureDacpacDeployment in Azure DevOps are examples of tasks that use SqlPackage underneath a management layer to facilitate deploying database changes.

Conversion tools

The process of converting an existing SQL project to an SDK-style project is done by manually editing the .sqlproj file to include the new SDK-style project format. Before beginning the process, it's recommended to both back up the project file and archive a .dacpac of the project. By comparing a "before" and "after" .dacpac built from the project, you can ensure that the conversion process has correctly completed.

Project/solution management

Multiple SQL projects (and other projects) can be logically grouped together in a solution file. The solution file is a container for one or more projects and is used to manage the projects as a group, including the build action. Large solutions can be broken down into smaller solutions to improve performance and manageability, or dynamically generated for the appropriate task at hand. The slngen solution file generator is available for Microsoft.Build.Sql projects and can be used to create a solution file for a set of projects programmatically and on-demand.

Third-party tools

There are third-party tools available that provide functionality related to SQL projects and database deployment. Some tools are open source, such as dbatools.

Developers have shared their projects utilizing extensibility points around SQL projects, including code analysis rules and customizing deployment plans. Some of these projects are:

Related content

close