CtrlK
BlogDocsLog inGet started
Tessl Logo

alonso-skills/mssql-server

Writes, optimizes, and debugs T-SQL queries. Explains SQL Server internals, troubleshoots performance issues, and guides database administration tasks including backup/restore, high availability, security, and index design. Use when the user asks about T-SQL syntax, SQL Server administration, query performance, stored procedures, indexes, locking, transactions, backup/restore, high availability, security, or any MSSQL-related topic — even without saying 'SQL Server' explicitly. Also trigger on terms like SSMS, tempdb, bcp, sqlcmd, MSSQL, sp_executesql, NOLOCK, columnstore, Hekaton, RCSI, param sniffing, or execution plan.

100

Quality

100%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files
name:
mssql-server
description:
Writes, optimizes, and debugs T-SQL queries. Explains SQL Server internals, troubleshoots performance issues, and guides database administration tasks including backup/restore, high availability, security, and index design. Use when the user asks about T-SQL syntax, SQL Server administration, query performance, stored procedures, indexes, locking, transactions, backup/restore, high availability, security, or any MSSQL-related topic — even without saying 'SQL Server' explicitly. Also trigger on terms like SSMS, tempdb, bcp, sqlcmd, MSSQL, sp_executesql, NOLOCK, columnstore, Hekaton, RCSI, param sniffing, or execution plan.

MSSQL Server Skill

How to use this skill

  1. Identify the topic using the routing table below (keyword → file mapping).
  2. Read the relevant reference file(s). Never answer from memory alone when a reference file covers the topic.
  3. Cross-cutting questions — identify ALL matching rows and read each file. Check "See Also" sections for additional files.
  4. Ambiguous keywords — read the "Disambiguation" column. When in doubt, load both files.
  5. Response format: Lead with code/pattern, follow with caveats in admonition blocks, end with source links.

Quick Examples

-- Basic filtered query with pagination
SELECT CustomerName, Email
FROM Customer
WHERE Status = 'Active'
ORDER BY CustomerName
OFFSET 0 ROWS FETCH NEXT 25 ROWS ONLY;

-- Create a covering index
CREATE NONCLUSTERED INDEX IX_Customer_Status
ON Customer(Status) INCLUDE (CustomerName, Email);

Routing Table

Keywords / TriggersFileScopeDisambiguation
CREATE TABLE, ALTER TABLE, DROP, schema, sequence, synonym, computed columnreferences/01-syntax-ddl.mdDDL syntax reference
SELECT, JOIN, subquery, UNION, INTERSECT, EXCEPT, window function, PIVOT, UNPIVOT, APPLY, OFFSET FETCH, paginationreferences/02-syntax-dql.mdDQL / query syntax
INSERT, UPDATE, DELETE, MERGE, OUTPUT clause, upsertreferences/03-syntax-dml.mdDML syntax & patterns
CTE, WITH, recursive CTE, anchor member, MAXRECURSIONreferences/04-ctes.mdCTEs (recursive & non-recursive)
VIEW, indexed view, SCHEMABINDING, partitioned view, WITH CHECK OPTIONreferences/05-views.mdViews
stored procedure, param sniffing, TVP, output param, EXECUTE AS user, impersonation, security contextreferences/06-stored-procedures.mdStored proceduresOPTION RECOMPILE: here for proc-level usage; see also 32 for query-level hint. EXECUTE AS: here for proc context; see also 15 for server/db principals
function, scalar UDF, inline TVF, multi-statement TVF, determinism, UDF inliningreferences/07-functions.mdUser-defined functions
index, clustered, nonclustered, covering index, include columns, fill factor, fragmentation, heap, forwarded record, rebuild, reorganize, B-tree structurereferences/08-indexes.mdIndex design & maintenancemissing index: here for DMV queries and index design; see also 32 for broader perf diagnostics
columnstore, delta store, rowgroup, batch mode, tuple mover, segment eliminationreferences/09-columnstore-indexes.mdColumnstore indexes
partition, partition function, partition scheme, partition switching, sliding window, STATISTICS_INCREMENTALreferences/10-partitioning.mdTable partitioning
user-defined type, CLR type, table type, alias type, spatial, geometry, geography, sparse columnreferences/11-custom-data-types.mdCustom data types
CHECK constraint, DEFAULT constraint, UNIQUE constraint, foreign key, cascade, referential integrity, functional constraint, cross-database constraint, cross-schema, computed column indexreferences/12-custom-defaults-rules.mdConstraints & defaults
transaction, isolation level, SNAPSHOT, RCSI, READ_COMMITTED_SNAPSHOT, ALLOW_SNAPSHOT_ISOLATION, MVCC, row versioning, lock escalation, lock hint, NOLOCK, UPDLOCK, ROWLOCKreferences/13-transactions-locking.mdTransactions & lockingdeadlock: here for theory, prevention, lock mechanics; see also 33 for XE deadlock graph capture. wait stats: here for lock-related waits; see also 32 for full wait stats diagnostics
TRY CATCH, THROW, RAISERROR, error handling, savepoint, @@TRANCOUNT, XACT_ABORTreferences/14-error-handling.mdError handling
login, user, role, server principal, database principal, GRANT, DENY, REVOKE, permission, ownership chaining, application rolereferences/15-principals-permissions.mdPrincipals & permissionsEXECUTE AS: here for principal impersonation; see also 06 for proc-level EXECUTE AS
RLS, row-level security, dynamic data masking, TDE, Always Encrypted, column encryption, certificate, DDM, encryption algorithm, AES, RSA, CEK, CMK, key rotation, HSMreferences/16-security-encryption.mdSecurity & encryption
temporal table, system-versioned, AS OF, time travel, FOR SYSTEM_TIME, retention policyreferences/17-temporal-tables.mdTemporal tables
In-Memory OLTP, Hekaton, memory-optimized table, natively compiled, hash index, range index, durabilityreferences/18-in-memory-oltp.mdIn-Memory OLTP
JSON, XML, FOR JSON, FOR XML, OPENJSON, JSON_VALUE, JSON_QUERY, JSON_MODIFY, XQuery, XML indexreferences/19-json-xml.mdJSON & XML
full-text search, FTS, CONTAINS, FREETEXT, CONTAINSTABLE, FREETEXTTABLE, semantic search, stopword, thesaurusreferences/20-full-text-search.mdFull-text & semantic search
graph table, node table, edge table, MATCH, SHORTEST_PATH, multi-hop, graph traversalreferences/21-graph-tables.mdGraph tables
ledger table, append-only ledger, updatable ledger, digest, ledger verification, blockchainreferences/22-ledger-tables.mdLedger tables
dynamic SQL, sp_executesql, SQL injection, parameterized query, dynamic WHERE, EXECreferences/23-dynamic-sql.mdDynamic SQL
string function, date function, math function, STRING_AGG, CONCAT_WS, FORMAT, DATEADD, DATEDIFF, AT TIME ZONE, datetime2, datetimeoffset, TRIM, TRANSLATEreferences/24-string-date-math-functions.mdBuilt-in functions reference
NULL, ISNULL, COALESCE, NULLIF, three-valued logic, IS DISTINCT FROM, nullable indexreferences/25-null-handling.mdNULL handling
collation, case-sensitive, accent-sensitive, COLLATE clause, collation conflict, Latin1_General, BIN2references/26-collation.mdCollation
cursor, FAST_FORWARD, KEYSET, STATIC, DYNAMIC, FORWARD_ONLY, cursor anti-patternreferences/27-cursors.mdCursors
statistics, auto-update, ascending key, histogram, DBCC SHOW_STATISTICS, UPDATE STATISTICS, filtered statisticsreferences/28-statistics.mdStatistics
execution plan, SHOWPLAN, STATISTICS IO, STATISTICS TIME, Index Seek, Key Lookup, Hash Join, Nested Loop, cardinality, plan warning, implicit conversionreferences/29-query-plans.mdQuery plans
Query Store, regressed query, forced plan, PSPO, parameter-sensitive plan, CE feedbackreferences/30-query-store.mdQuery Storewait stats: here for QS-integrated wait stats; see also 32 for server-level wait stats
IQP, Intelligent Query Processing, memory grant feedback, batch mode on rowstore, interleaved execution, DOP feedback, table variable deferred compilation, approximate countreferences/31-intelligent-query-processing.mdIntelligent Query Processing
wait stats, missing index DMV, plan cache, OPTION RECOMPILE, MAXDOP hint, sp_Blitz, sp_BlitzCache, sp_BlitzFirst, sp_BlitzIndex, FORCESEEK, FORCESCANreferences/32-performance-diagnostics.mdPerformance diagnosticsOPTION RECOMPILE: here for query hint usage; see also 06 for proc-level param sniffing. missing index: here for perf triage; see also 08 for index design decisions
Extended Events, XE session, deadlock graph, blocking detection, ring buffer, event file, sys.dm_xereferences/33-extended-events.mdExtended Eventsdeadlock graph: here for XE capture mechanics; see also 13 for deadlock theory and prevention
tempdb, TF 1117, TF 1118, GAM, SGAM, PFS, allocation latch, temp table, table variable, version storereferences/34-tempdb.mdtempdb
DBCC, CHECKDB, FREEPROCCACHE, DROPCLEANBUFFERS, SHRINKFILE, SHRINKDATABASE, UPDATEUSAGE, INPUTBUFFER, OPENTRANreferences/35-dbcc-commands.mdDBCC commands
data compression, ROW compression, PAGE compression, COLUMNSTORE compression, sp_estimate_data_compression_savingsreferences/36-data-compression.mdData compression
CDC, Change Data Capture, Change Tracking, CT, ETL, cdc.fn_cdc_get_all_changes, CHANGETABLEreferences/37-change-tracking-cdc.mdChange Tracking & CDC
SQL Server Audit, SERVER AUDIT, audit specification, compliance, SOX, HIPAA, PCI-DSS, audit logreferences/38-auditing.mdAuditing
trigger, DML trigger, DDL trigger, logon trigger, AFTER, INSTEAD OF, inserted, deleted, COLUMNS_UPDATEDreferences/39-triggers.mdTriggers
Service Broker, SSB, queue, SEND, RECEIVE, dialog conversation, activation, message type, contract, pub/subreferences/40-service-broker-queuing.mdService Broker & queuing
replication, snapshot replication, transactional replication, merge replication, publisher, distributor, subscriber, replication agentreferences/41-replication.mdReplication
database snapshot, AS SNAPSHOT OF, sparse file, REVERT, consistent readreferences/42-database-snapshots.mdDatabase snapshots
Always On, Availability Group, AG, listener, readable secondary, quorum, distributed AG, contained AG, log shipping, FCI, failover clusterreferences/43-high-availability.mdHigh availability
BACKUP, RESTORE, full backup, differential, log backup, tail log, point-in-time restore, NORECOVERY, STANDBY, S3 backup, backup encryptionreferences/44-backup-restore.mdBackup & restore
linked server, four-part name, OPENQUERY, OPENDATASOURCE, distributed transaction, DTCreferences/45-linked-servers.mdLinked servers
PolyBase, external table, external data source, OPENROWSET, S3, Azure Blob, Hadoop, predicate pushdownreferences/46-polybase-external-tables.mdPolyBase & external tables
sqlcmd, bcp, sqlpackage, mssql-cli, BULK INSERT, OPENROWSET BULK, format file, dacpac, bacpac, PowerShell SQLServerreferences/47-cli-bulk-operations.mdCLI & bulk operations
Database Mail, sp_send_dbmail, mail profile, mail account, HTML mail, Agent alert notificationreferences/48-database-mail.mdDatabase Mail
sp_configure, max server memory, MAXDOP, cost threshold, Resource Governor, trace flag, NUMAreferences/49-configuration-tuning.mdConfiguration & tuningMAXDOP: here for server config; see also 32 for MAXDOP query hint
SQL Server Agent, job, job step, schedule, alert, operator, proxy, msdb, multi-serverreferences/50-sql-server-agent.mdSQL Server Agent
SQL Server 2022, ledger 2022, S3 backup 2022, contained AG 2022, IS_DISTINCT_FROM, GREATEST, LEAST, XML compressionreferences/51-2022-features.mdSQL Server 2022 features
SQL Server 2025, vector search, VECTOR type, vector index, AI features, 2025 T-SQLreferences/52-2025-features.mdSQL Server 2025 features
compatibility level, CE version, cardinality estimator, deprecated feature, upgrade, migration, contained databasereferences/53-migration-compatibility.mdMigration & compatibility
SQL Server on Linux, Docker, mssql-conf, container, Pacemaker, mssql-tools, Linux limitationsreferences/54-linux-containers.mdLinux & containers
Workspace
alonso-skills
Visibility
Public
Created
Last updated
Publish Source
CLI
Badge
alonso-skills/mssql-server badge