Skill 2.3.3
Create, build, and validate database models by using SQL Database Projects, including SDK-style models
Key Concepts
SDK-style projects use the Microsoft.Build.Sql SDK in the .sqlproj file, run on .NET on Windows, Linux and macOS, include every .sql file in the folder by default, and support NuGet package references for database references. They are created with dotnet new sqlproj (from the Microsoft.Build.Sql.Templates package), with the SQL Database Projects extension in VS Code, or by importing an existing database, and are built with dotnet build. The original (non-SDK) format requires .NET Framework and Visual Studio.
The build validates each object's syntax against the project's target platform (the DSP property, such as SQL Server 2025 or Azure SQL Database) and checks references between objects, so a view that names a missing column fails the build. Code analysis rules (enabled with RunSqlCodeAnalysis) report issues such as deprecated syntax or non-SARGable predicates. References to other databases and system objects are added as dacpac or package references.