Blog Post

Azure SQL Blog
4 MIN READ

Recently released: Updates to SQL projects in SSMS, VS Code, and SqlPackage

DrewSkwiersKoballa's avatar
Jul 20, 2026

Your database should be part of the same development process as the rest of your application, with source control and automation for validation and deployment. Recent releases of SQL Server Management Studio (SSMS), the SQL Database Projects extension for Visual Studio Code, SqlPackage, and the Microsoft.Build.Sql SDK add capabilities for the SQL projects ecosystem focused on developing, evolving, and deploying SQL databases.

Whether you are starting from an existing database, adding a database to a deployment pipeline, or refining a mature SQL project, the following updates make incorporating your database with your overall DevOps strategy more efficient.

System database references in SSMS

SSMS 22.8 adds system database references for SQL projects. Database references let a project use objects defined outside its local source files, whether those objects are in the same database or another database. The new system database packages for master and msdb let you reference system objects without manually managing the associated database artifacts.

Add a package reference from the command line with dotnet add package. For example, add the SQL Server 2025 master database package:

dotnet add package Microsoft.SqlServer.Dacpacs.Master --version 170.0.4

System database references can also be viewed and added from Solution Explorer in SSMS 22.8. Because the system database references are done through package references, no additional configuration is required to build the project with the .NET SDK in CI/CD pipelines.

Enabling projects to reference system objects with database references

Other recent SSMS releases added additional capabilities across the SQL project lifecycle through the Database DevOps (preview) workload. When you create a project, select its target platform in the new project dialog. The target platform determines the Microsoft SQL version against which the project validates syntax. After creating a project, use the project properties editor to change the target platform, configure code analysis, and define SQLCMD variables. SQLCMD variables resolve only at deployment time, allowing deployment-specific behavior without changing the project source.

New SQL project dialog in SQL Server Management Studio 22.8

SSMS 22.7 introduced schema compare and SQL formatting. Learn more in Power up in SSMS 22.7: Schema compare and SQL formatting

Schema compare in SSMS gives an object-level view of differences between databases and projects

Update to SSMS 22.8 and explore the SSMS 22 release notes and database references documentation.

SQL projects in Visual Studio Code

The 1.6.2 release of the SQL Database Projects extension for Visual Studio Code continues to improve the SQL project development experience in the cross-platform and mutli-functional VS Code environment. Install or update to version 1.6.2 to use the latest capabilities.

Project IntelliSense suggests object names from your SQL project model and enables Go to Definition and refactoring actions. When you refactor an object, Visual Studio Code updates the local `.sql` files and records the change in refactorlog.xml. Deploying your SQL project from an IDE or CLI, including Visual Studio Code and SqlPackage, uses this log to apply "sp_rename" and "ALTER SCHEMA ... TRANSFER" when required. This preserves the intent of your change during deployment instead of treating a renamed object as a drop and create operation. For more details on how SQL projects track and deploy these changes, see the SQL projects refactoring documentation.

Review the cascade of changes when updating the name of a table in a SQL project

When you create an object through SQL project explorer, the extension can automatically organize its file by schema and object type. This organizational pattern is the most prevalent standard, although some teams have alternative structures. To manually organize the files only, set "sqlDatabaseProjects.autoCreateFolders" to false in Visual Studio Code settings.

Extract an existing database to a SQL project with the SqlPackage CLI

The 170.4 release of SqlPackage in June 2026 adds a one-command path to turn an existing database into its full code definition. Set the ExtractTarget property to SqlProject during extract to reverse engineer the database into a Microsoft.Build.Sql project instead of the default .dacpac output format. The generated project contains individual .sql files for database objects and a .sqlproj file for database-level settings.

The generated SQL project can be iteratively developed, compiled to a .dacpac with dotnet build, or checked into source control as the foundation for database CI/CD.

For example, use the following command to create a SQL project from a database connection string in the `AdventureWorks` folder:

sqlpackage /a:extract /scs:"yourconnectionstring" /tf:AdventureWorks /p:ExtractTarget=SqlProject

The generated project is identical to the same SQL project you would create from that database in a graphical development environment:

AdventureWorks extracted to a SQL project, automatically organized by schema and objec type

For the complete release details, see the SqlPackage release notes.

Database settings in the Microsoft.Build.Sql project SDK

Microsoft.Build.Sql SDK 2.2.0, released with DacFx 170.4 in June 2026, adds support for automatic index compaction. This database-level feature is in preview for Azure SQL Database and SQL database in Fabric, where it compacts indexes in the background with minimal overhead. For more information, see Stop defragmenting and start living: Introducing auto index compaction

SQL projects can define database-level settings as properties in the .sqlproj file, including:

  • Change tracking
  • Query Store stale query threshold
  • Compatibility mode

Microsoft.Build.Sql 2.2.0 adds the AutomaticIndexCompaction property so you can enable or disable automatic index compaction as part of a SQL project deployment. Database settings in the project file make these deployment decisions visible in source control and repeatable across your environments. Review the SQL projects properties documentation for more available settings.

Provide feedback and learn more

To learn about the future planned work and avenues for feedback across the SQL projects ecosystem, visit the SQL projects roadmap.

Use Microsoft.Build.Sql projects to branch, build, commit, and deploy your database. Get started from an existing database or create a new SQL project. Learn more about SQL projects as part of CI/CD in Azure DevOps from a recent blog post in Azure SQL Dev Corner and associated Data Exposed episode. 

 

 

Updated Jul 17, 2026
Version 1.0
No CommentsBe the first to comment