SqlServer.Rules

MCP.Pizza Chef: ErikEJ

T-SQL Analyzer reviews SQL scripts and whole database projects against a large rule library, then reports what it finds: risky patterns, performance traps, and design or naming problems. Connected to GitHub Copilot Chat in VS Code or Visual Studio, you can ask for that review in plain language and get specific feedback back in the chat. Installation is a one-click button in either editor, and no account or key is needed. The same rules can also run automatically whenever a database project is built.

Coding
Data

Use This MCP server To

Check my SQL for common mistakes before I ship it Ask Copilot to review a stored procedure I just wrote Catch slow query patterns early in a database project Enforce the same SQL standards across a whole team Get a written list of issues in a folder of scripts

README

Static Analysis Rule-sets for SQL Projects

MCP Toplist

build status latest version GitHub Sponsors

Overview

A library of SQL best practices implemented as over 140 database code analysis rules checked at build time.

The rules can be added as NuGet packages to SQL Database projects:

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

Component Stack

SqlServer.Rules FAQ

Which apps does it work in?
GitHub Copilot Chat in VS Code and Visual Studio, using the one-click install buttons in the project's readme.
Do I need an account or key?
No. It runs locally as a command line tool that your editor starts for you.
Can I use this to review a SQL script before a release?
Yes. Point it at a single script or an entire database project and it reports every rule it flags.
How many checks are there?
More than 140 rules covering SQL Server best practices, with the full list published in the project docs.
Does it change my SQL?
No. It reports the issues it finds and leaves every decision to you.
Does it work outside an assistant?
Yes. There are extensions for Visual Studio, SQL Server Management Studio, and VS Code, plus a command line tool.