Integrates with GitHub repositories for SQL code analysis, as evidenced by the build status badge and GitHub actions workflow references.
Uses GitHub Actions for CI/CD pipeline execution, showing build status via badges.
Generates documentation in Markdown format from rule inspection, stored in the docs directory.
Built as .NET libraries and tools, providing static code analysis rules for SQL Server projects within the .NET ecosystem.
Publishes SQL rules as NuGet packages that can be added to SQL database projects, with direct integration via 'dotnet add package' commands.
Displays build status and package version badges from Shields.io in the README.
Static Analysis Rule-sets for SQL Projects
Overview
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 modern SQL Database projects based on either MSBuild.Sdk.SqlProj or Microsoft.Build.Sql.
You can also download and manually use the rules with Visual Studio and "classic" SQL Database projects, as described in my blog post here.
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
Usage
The latest version is available on NuGet
You can read more about using and customizing the rules in the readme here
Command line tool - T-SQL Analyzer CLI
This repository also contains a .NET commmand line tool, that uses the rule sets. Read more in the dedicated readme file
Solution Organization
.github
- GitHub actions
docs
- markdown files generated from rule inspection with the DocsGenerator unit test
Solution Items
- files relating to build etc.
src
SqlServer.Rules
- This holds the rules derived fromSqlCodeAnalysisRule
TSQLSmellSCA
- an additional set of rulesTSQL Smells
forked from TSQL-Smells
test
SqlServer.Rules.Tests
- a few test to demonstrate unit testing of rulesTSQLSmellsSSDTTest
- unit tests of some of theTSQL Smells
rulesTestHelpers
- shared test base classes
tools
SqlAnalyzerCli
- a command line tool to run rules against a SQL ProjectErikEJ.DacFX.TSQLAnalyzer
- library and NuGet package for running rules against SQL scripts and reporting results. Used bySqlAnalyzerCli
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.
sqlprojects
AW
- AdventureWorks schema SQL Project for rules validationTestDatabase
- a small SQL Database Project with some rule violationsTSQLSmellsTest
- a SQL Database Project with some rule violations
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
T-SQL Analyzer
Related MCP Servers
- GoMIT License
- Python
- -securityAlicense-qualitySQL Server Analysis Services MCP Server by CDataLast updated -MIT License
- TypeScriptMIT License