Skip to content

hmohamed01/SQL-Expert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Expert

License: MIT SQL Server Claude Code

A Claude Code skill for Microsoft SQL Server and T-SQL development expertise.

Overview

This skill provides guidance for writing, optimizing, and debugging T-SQL queries. It covers advanced querying techniques, performance tuning, security best practices, and transaction management.

Features

  • Live Documentation Verification - Verifies T-SQL syntax against Microsoft's official sql-docs repository using WebFetch, with WebSearch fallback and conditional verification tiers (MUST/SHOULD/Skip) to balance accuracy with efficiency
  • Structured Workflows - Guided workflows for query development, performance optimization, and security implementation
  • Quick-Reference Patterns - Inline examples for common tasks like pagination, running totals, and safe dynamic SQL
  • Anti-Pattern Detection - Catches non-SARGable predicates, implicit conversions, and other performance pitfalls
  • Comprehensive References - Five detailed reference docs covering query patterns, performance tuning, security, data types, and transactions

Installation

Clone this repository, then copy the sql-expert folder to your skills directory:

User-level (all projects)

macOS/Linux:

cp -r sql-expert ~/.claude/skills/

Windows (PowerShell):

Copy-Item -Recurse sql-expert $HOME\.claude\skills\

Project-level (current project only)

macOS/Linux:

cp -r sql-expert .claude/skills/

Windows (PowerShell):

Copy-Item -Recurse sql-expert .claude\skills\

Repository Structure

SQL-Expert/
├── README.md
└── sql-expert/                   # <- Copy this folder to your skills directory
    ├── SKILL.md                  # Main skill definition with core instructions
    └── references/
        ├── patterns.md           # Query patterns: CTEs, pagination, PIVOT, MERGE, window functions
        ├── performance.md        # Execution plans, parameter sniffing, Query Store, wait statistics
        ├── security.md           # SQL injection prevention, dynamic SQL, permissions, data masking
        ├── data-types.md         # Type selection, collation, precision/scale, storage optimization
        └── transactions.md       # Isolation levels, deadlocks, distributed transactions, sagas

Usage

Once installed, Claude Code will automatically use this skill when you ask about:

  • T-SQL query writing or optimization
  • SQL Server stored procedures
  • Database performance tuning
  • Query execution plans
  • SQL security and injection prevention

SQL Server Version Support

The skill covers features from SQL Server 2016 through 2022, with version annotations where applicable.

License

MIT

About

A Claude Code skill for T-SQL and SQL Server expertise: query patterns, performance tuning, security, and transactions

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors