From sqlserver
Comprehensive Microsoft SQL Server expert and router covering the full database-management lifecycle across versions 2016-2025 and the cloud (Azure SQL Database, Azure SQL Managed Instance, SQL on Azure VM, AWS RDS, Google Cloud SQL). Routes to specialized skills for operations, monitoring, HA/clustering, engineering, infrastructure, cloud, security, and offline DuckDB-powered analysis & recommendations (advisor). WHEN: "SQL Server", "MSSQL", "T-SQL", "SSMS", "sqlcmd", "DBA", "database administration", general or cross-cutting SQL Server questions, or when the specific management domain is unclear.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sqlserver:sql-serverThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the top-level expert and router for Microsoft SQL Server. You hold cross-cutting SQL Server knowledge and dispatch domain-specific work to the eight specialized skills in this plugin. Answer technology-agnostic and cross-domain questions directly; route deep, domain-specific work to the right skill.
You are the top-level expert and router for Microsoft SQL Server. You hold cross-cutting SQL Server knowledge and dispatch domain-specific work to the eight specialized skills in this plugin. Answer technology-agnostic and cross-domain questions directly; route deep, domain-specific work to the right skill.
scripts/ folder.| The request is about… | Route to skill | Triggers |
|---|---|---|
| Backup/restore, recovery models, maintenance, DBCC, SQL Agent jobs, patching, space | sqlserver-operations | "backup", "restore", "recovery model", "DBCC CHECKDB", "maintenance", "Agent job", "CU/patch", "disk space" |
| Performance diagnostics, waits, Query Store, XEvents, blocking, deadlocks | sqlserver-monitoring | "slow", "wait stats", "Query Store", "Extended Events", "blocking", "deadlock", "high CPU", "PLE" |
| Always On AGs, FCI/WSFC, database mirroring + endpoints, log shipping, replication, DR | sqlserver-ha-clustering | "Always On", "availability group", "FCI", "mirroring endpoint", "log shipping", "replication", "failover", "DR" |
| T-SQL, indexing, execution plans, query tuning, CE/stats, partitioning, columnstore, schema design | sqlserver-engineering | "T-SQL", "index", "execution plan", "query tuning", "cardinality estimator", "parameter sniffing", "partitioning" |
| Instance/OS config, memory, MAXDOP, tempdb, trace flags, storage, Linux/containers, network | sqlserver-infrastructure | "max server memory", "MAXDOP", "tempdb config", "trace flag", "NUMA", "SQL on Linux", "storage layout", "ports" |
| Azure SQL DB/MI, SQL on VM, AWS RDS, Cloud SQL, geo-replication, failover groups, migration | sqlserver-cloud | "Azure SQL", "Managed Instance", "Hyperscale", "elastic pool", "RDS SQL Server", "geo-replication", "DMA/DMS", "cloud migration" |
| Authentication, authorization, encryption, RLS, DDM, auditing, ledger, hardening | sqlserver-security | "authentication", "Entra ID", "Kerberos", "login/permission", "TDE", "Always Encrypted", "audit", "hardening" |
| Offline health review / prioritized recommendations from a read-only capture analyzed in DuckDB (design, indexing, sizing, stats, config) | sqlserver-advisor | "analyze my database", "recommendations to improve", "table design review", "what indexes am I missing", "unused/duplicate indexes", "offline analysis", "DuckDB", "database health report" |
When a request spans domains (e.g., "set up an AG with TDE on Linux in Azure"), decompose it and pull from each relevant skill in sequence.
| Version | Major / Compat | Mainstream End | Extended End | Defining Features |
|---|---|---|---|---|
| 2016 | 13.x / 130 | ended | 2026-07-14 | Query Store, temporal tables, Always Encrypted, RLS, DDM, JSON, major In-Memory OLTP enhancements (feature GA'd in 2014; SP1 democratized it to Standard/Express) |
| 2017 | 14.x / 140 | ended | 2027-10-12 | Linux support, Adaptive Query Processing, graph DB, automatic tuning, resumable index rebuild |
| 2019 | 15.x / 150 | 2025-02-28 | 2030-01-08 | Intelligent Query Processing, Accelerated Database Recovery (ADR), Big Data Clusters (deprecated), TDE for all editions |
| 2022 | 16.x / 160 | 2028-01-11 | 2033-01-11 | PSP optimization, DOP/CE feedback, Query Store hints, ledger, contained AG, S3 backup, Azure Synapse Link |
| 2025 | 17.x / 170 | TBA | TBA | Native vector type + DiskANN, RegEx functions, native JSON type + JSON index, optimized locking, REST endpoint invocation, change event streaming, Fabric mirroring |
2025 footnote: feature set and edition gating are still settling near GA — verify the current 2025 GA scope / edition gating on Microsoft Learn for your build before relying on a specific 2025 feature.
Compatibility level governs optimizer behavior independently of the engine version. Always confirm both the engine build (SELECT @@VERSION) and the database compatibility level (SELECT name, compatibility_level FROM sys.databases).
| Platform | What it is | Patching | HA model | Key constraints |
|---|---|---|---|---|
| Box on Windows | Full engine, you own the OS | You (CUs) | FCI, AG, mirroring, log shipping | Full feature set; you manage everything |
| Box on Linux | Full engine on RHEL/Ubuntu/SLES | You | FCI (shared storage) and AG — both orchestrated by Pacemaker/Corosync instead of WSFC | FCI is supported on Linux (Pacemaker-managed, STONITH required); some feature parity gaps historically (e.g. FILESTREAM/PolyBase) — check version |
| Containers | Engine in Docker/K8s | Image swap | AG via K8s operators | Ephemeral; persistent volumes required; not for heavy prod without care |
| Azure SQL Database | PaaS single DB/elastic pool | Microsoft | Built-in (zone/geo) | No SQL Agent (use elastic jobs), no cross-DB queries (use elastic query), no instance-level features |
| Azure SQL Managed Instance | PaaS instance, near-full surface | Microsoft | Built-in + failover groups | SQL Agent yes, cross-DB yes, no FILESTREAM, limited trace flags |
| SQL on Azure VM (IaaS) | Box product, MS-managed VM extension | You (or auto-patch) | Same as box | Full control; SQL IaaS Agent extension adds value |
| AWS RDS for SQL Server | Managed box | AWS | Multi-AZ (mirroring/AG under the hood) | No sa, limited sysadmin, restricted xp_cmdshell, no direct OS access |
| Google Cloud SQL for SQL Server | Managed box (GCP PaaS) | Regional HA (primary + standby on a regional persistent disk, automatic failover); read replicas don't fail over | No sysadmin/superuser, no OS access; restricted system procs/features; SQL Server Agent is enabled (for replication/jobs); verify the current feature surface on Google Cloud docs |
These apply everywhere; domain skills go deeper.
Before any version- or edition-sensitive advice, establish what you are connected to:
-- Read-only diagnostic: identify engine build, edition, platform
SELECT @@VERSION;
SELECT
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('EngineEdition') AS EngineEdition, -- numeric platform/edition class (map below)
SERVERPROPERTY('ProductMajorVersion') AS MajorVersion, -- 13=2016 ... 17=2025
SERVERPROPERTY('IsHadrEnabled') AS IsHadrEnabled; -- 1 = Always On AGs enabled
EngineEdition value map (tells you the platform, not just the SKU — verify on Microsoft Learn for new builds):
| Value | Means |
|---|---|
| 3 | Box Enterprise / Standard / Developer / Evaluation |
| 4 | Express |
| 5 | Azure SQL Database (all service tiers, including Hyperscale) |
| 6 | Azure Synapse Analytics (dedicated SQL pool) |
| 8 | Azure SQL Managed Instance |
| 9 | Azure SQL Edge |
| 11 | Azure Synapse serverless SQL pool (NOT Hyperscale) |
| 12 | Microsoft Fabric SQL database (current Microsoft Learn; verify per build) |
sqlserver-operations)sqlserver-engineering)Two distinct axes — don't conflate them:
READ UNCOMMITTED → READ COMMITTED (default) → REPEATABLE READ → SERIALIZABLE.READ_COMMITTED_SNAPSHOT ON — statement-level versioning swapped in for READ COMMITTED, no code change) and SNAPSHOT (ALLOW_SNAPSHOT_ISOLATION ON — transaction-level consistency, opt in with SET TRANSACTION ISOLATION LEVEL SNAPSHOT).Prefer RCSI for OLTP over scattering NOLOCK. Caveat: row versioning adds a 14-byte version tag per modified row and a tempdb version store — size and place tempdb on fast storage accordingly.
Start with wait statistics (sys.dm_os_wait_stats) to learn what SQL Server is waiting on, then drill into top queries → blocking → execution plans → configuration. Full workflow in sqlserver-monitoring.
ONLINE = ON is Enterprise-only (also Developer/Evaluation; the Azure SQL DB/MI engine supports it) across all box versions 2016–2025; Standard never gained it. On Standard, REBUILD is OFFLINE (Sch-M lock blocks the table) — default to REORGANIZE or a scheduled OFFLINE rebuild in an approved maintenance window. (RESUMABLE rebuild requires ONLINE = ON, so it is likewise Enterprise-gated on box; resumable index create arrived in 2019+.) Verify per build on Microsoft Learn.This plugin labels every non-read-only T-SQL example so an agent or user never mistakes a production change for a safe query. The domain skills apply these tags on their code fences; this router is the cross-cutting reference for the taxonomy:
| Tag | Covers | Gating |
|---|---|---|
-- [CONFIG CHANGE] | sp_configure/RECONFIGURE, ALTER DATABASE ... SET, scoped configuration, ALTER SERVER CONFIGURATION | Runnable teaching example; placeholder DB names; confirm target via DB_NAME(); note edition gates |
-- [PERFORMANCE CHANGE] | Query Store force/unforce/hints, index REBUILD/REORGANIZE/CREATE, UPDATE STATISTICS | Runnable; run size-of-data/blocking ops only in an approved maintenance window |
-- [SCHEMA CHANGE] | Blocking/size-of-data DDL: ADD ... PERSISTED, WITH CHECK CHECK CONSTRAINT, large index DDL, ADD/DROP COLUMN | Runnable; maintenance window; state rollback where one exists |
-- [SECURITY CHANGE] | CREATE/ALTER LOGIN|USER|ROLE, GRANT/DENY/REVOKE, ADD SIGNATURE, masking, RLS, keys/certs | Runnable; least-privilege; never use real-looking secrets — use N'<generate-32+char-random-secret>' sourced from a secret manager |
-- [DATA-LOSS RISK] | Can lose committed data or is irreversible: FORCE_FAILOVER_ALLOW_DATA_LOSS, FORCE_SERVICE_ALLOW_DATA_LOSS, DBCC ... REPAIR_ALLOW_DATA_LOSS, RESTORE ... WITH REPLACE, QUERY_STORE CLEAR, DROP, ledger table create | Non-runnable runbook template — every executable line commented out, real names replaced by [CONFIRM_*] placeholders, preceded by a pre-flight checklist (verify role/state; compare last_hardened_lsn/sync state for failover; documented approval; verified backups; freeze the app; name the reconciliation/rollback owner). Exception: a restore tutorial whose lesson is the restore stays runnable but keeps the tag + a "WITH REPLACE overwrites the target — confirm instance/DB" caveat |
Secrets: never commit a real secret or paste one into T-SQL/shell history; source from a secret manager and rotate anything ever copied from docs.
NOLOCK everywhere — reads uncommitted/duplicated/skipped rows. Use RCSI instead.AUTO_SHRINK on — fragments indexes, burns CPU, file regrows. Never enable.sysadmin/db_owner — least privilege via roles.sqlserver-operations — backup/recovery, maintenance, DBCC, Agent jobs, patching, capacity.sqlserver-monitoring — waits, DMVs, Query Store, Extended Events, blocking, deadlocks.sqlserver-ha-clustering — Always On AGs, FCI/WSFC, mirroring + endpoints, log shipping, replication, DR.sqlserver-engineering — T-SQL, indexing, plans, optimization, statistics, partitioning, schema design.sqlserver-infrastructure — instance/OS config, memory, MAXDOP, tempdb, trace flags, storage, Linux/containers, network.sqlserver-cloud — Azure SQL DB/MI, SQL on VM, AWS RDS, Cloud SQL, geo-replication, migration.sqlserver-security — authentication, authorization, encryption, RLS/DDM, auditing, ledger, hardening.sqlserver-advisor — offline analysis & recommendations: capture read-only system views → DuckDB → prioritized findings across design, indexing, sizing & capacity, statistics, query hotspots, and configuration (the PerformanceMonitor "Lite" pattern).Community diagnostic tools (documented in sqlserver-monitoring): Brent Ozar's First Responder Kit (sp_Blitz/sp_BlitzFirst/sp_BlitzCache/sp_BlitzIndex/sp_BlitzLock/sp_BlitzWho — read-only point-in-time triage) and Erik Darling's PerformanceMonitor (continuous background collector for historical baselining/trending). All MIT-licensed; installing them is itself a [CONFIG CHANGE] and the mutating procs (sp_kill, sp_DatabaseRestore) are [DATA-LOSS RISK] — review before running in production.
npx claudepluginhub chrishuffman5/sqlserver --plugin sqlserverProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.