Skip to content

Latest commit

 

History

History

Microsoft.Build.Sql.Templates

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Microsoft.Build.Sql.Templates

Installing the templates

The templates are available on NuGet. To install the templates, run the following command:

dotnet new install Microsoft.Build.Sql.Templates

Using the templates

SQL project

Creating a new project "AdventureWorks" (-n or --name):

dotnet new sqlproj -n "AdventureWorks"

Displaying help information for the SQL project template (-h):

dotnet new sqlproj -h

Creating a new project "AdventureWorksLT" for Azure SQL Database (-tp or --target-platform):

dotnet new sqlproj -n "AdventureWorksLT" -tp "SqlAzureV12"

Creating a new project "AdventureWorks" with a .gitignore file (-g):

dotnet new sqlproj -n "AdventureWorks" -g

New sample code analysis rule

Creating a new sample code analysis rule "WaitForDelay" (-n or --name):

dotnet new sqlcodeanalysis -n "WaitForDelay"

Displaying help information for the SQL code analysis template (-h):

dotnet new sqlcodeanalysis -h

Building the templates

If you want to customize or contribute to the templates, you will need to build and install the templates locally. The following instructions will help you get started.

The templates automatically generate a nupkg on build. To build and install the nupkg locally, run the following command:

dotnet build
dotnet new install bin/Debug/Microsoft.Build.Sql.Templates.1.0.0.nupkg

To uninstall the templates

dotnet new uninstall Microsoft.Build.Sql.Templates