Skip to content

ErikEJ/SqlServer.Rules

 
 

Repository files navigation

Static Analysis Rule-sets for SQL Projects

build status latest version latest version

Overview

A library of SQL best practices as database code analysis rules checked at build.

The rules can be added as NuGet packages to SQL projects based on either MSBuild.Sdk.SqlProj or Microsoft.Build.Sql

For a complete list of the current rules we have implemented see here.

This fork also contains an additional set of rules TSQL Smells forked from https://github.com/davebally/TSQL-Smells

Usage

The latest version is available on NuGet

dotnet add package ErikEJ.DacFX.SqlServer.Rules
dotnet add package ErikEJ.DacFX.TSQLSmellSCA

You can read more about using and customizing the rules in the readme here

Solution Organization

  • SqlServer.Dac - This hold visitors and other utility code
  • SqlServer.Rules - This holds the rules derived from SqlCodeAnalysisRule
  • SqlServer.Rules.Report - Library for evaluating a rule and serializing the result.
  • SqlServer.Rules.Generator - a quick console app to report on all rules in a SQL Project.
  • SqlServer.Rules.Tests - a few test to demonstrate unit testing of rules
  • TestDatabase - a small SQL Project to test with
  • TSQLSmellSCA - an additional set of rules TSQL Smells forked from https://github.com/davebally/TSQL-Smells

About

SQL Server static code analysis rules for SQL Projects

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Languages

  • C# 95.0%
  • TSQL 3.5%
  • XSLT 1.5%