A library of SQL best practices implemented as more than 120 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 TSQL-Smells
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
.github
- GitHub actions
docs
- markdown files generated from rule inspection with the DocsGenerator unit test
Solution Items
- files relating to build etc.
src
SqlServer.Dac
- This hold visitors and other utility codeSqlServer.Rules
- This holds the rules derived fromSqlCodeAnalysisRule
TSQLSmellSCA
- an additional set of rulesTSQL Smells
forked from TSQL-Smells
test
SqlServer.Rules.Generator
- a quick console app to report on all rules in a SQL Project.SqlServer.Rules.Report
- Library for evaluating a rule and serializing the result.SqlServer.Rules.Tests
- a few test to demonstrate unit testing of rulesTestDatabase
- a small SQL Database Project with some rule violationsTSQLSmellsSSDTTest
- unit tests of some of theTSQL Smells
rulesTSQLSmellsTest
- a SQL Database Project with some rule violations