SQL Server Skills
БесплатноЗапускает вложенные скриптыНе проверенComprehensive SQL Server performance diagnostics, index analysis, execution plan interpretation, query optimization, schema management, backup/restore, and…
от vince-winkintel1 360 установок в других каталогахОб этом скилле
SQL Server Skills — Comprehensive Reference
This skill provides complete reference and workflows for Microsoft SQL Server diagnostics, performance tuning, index management, execution plan analysis, and more. It covers 7 domains via sqlcmd and T-SQL DMV queries targeting SQL Server 2016+.
Overview
SQL Server Skills
Comprehensive SQL Server skill for AI agents. Covers performance diagnostics, index analysis, execution plan interpretation, query optimization, schema management, backup/restore, and monitoring — all via sqlcmd and T-SQL DMVs.
Requirements
sqlcmd— Microsoft Download- SQL Server 2016+ — All DMV queries target compatibility level 130+
- Permissions —
VIEW SERVER STATEfor most DMV queries; operation-specific least privilege and exact-target DBA review for changes
Identify whether the operator uses Go sqlcmd or ODBC sqlcmd before choosing
variant-specific flags. Go sqlcmd 1.11.0 or later is required for --ascii
and -j / --raw-errors (retains the mssql: error prefix, not a redaction
control). -F selects the certificate hostname, not the output format.
ASCII tables buffer rows and can silently truncate cells with ...; use only
small, narrow results, never query text, XML plans or generated DDL. -y, -Y
and -h are ignored in ASCII mode. -w / SQLCMDCOLWIDTH controls width;
otherwise stdout's terminal width applies even with -o file. Increasing width
does not guarantee complete values. Keep the default formatter for existing
workflows, including missing-index output with -y 0 -w 65535.
--sqlconfig belongs to the modern subcommand CLI (subcommand first, such as
sqlcmd config or sqlcmd query), not the legacy sqlcmd -S ... -Q/-i forms
used here. Its file contains YAML; Go sqlcmd 1.11.0 or later rejects suffixes
other than .yaml / .yml (case-insensitive). A suffix-free basename such as
sqlconfig is allowed; .sqlconfig is a suffix and is rejected.
In Go sqlcmd 1.11.0 or later, -G without -U selects
ActiveDirectoryDefault (an Azure credential chain); older versions selected
ActiveDirectoryIntegrated. Use only an operator-selected identity flow; do not
add -G to the authentication setup below or use it as a credential fallback.
These optional features do not raise the minimum for existing DMV workflows.
Microsoft's pinned source and feature history.
The optional sqlserver-diagnostics/references/go-sqlcmd.md in a manual repository
install adds detail; the single-file Claude.ai ZIP omits it and SQL scripts.
Use inline SQL in the merged sections, or the manual install for script workflows.
Quick Connect
Prefer integrated authentication (-E) with an operator-configured identity. For SQL
authentication, sqlcmd reads an already securely provisioned SQLCMDPASSWORD;
never expand it into arguments. Never ask for, print, or persist passwords. Do not
create password files, use shell tracing, or dump the environment. If no secure
authentication is available, stop and let the operator configure it outside the agent.
Choose exactly one authentication setup in the same Bash session as the workflows. The choice is explicit: a missing SQL password never falls back to another identity.
# Integrated authentication: operator-configured identity
SQL_AUTH=(-E)
# SQL Authentication: SQLCMDPASSWORD must already be exported securely
[ -n "${SQLCMDPASSWORD:-}" ] || { echo 'SQLCMDPASSWORD not provisioned or empty' >&2; exit 1; }
export SQLCMDUSER="${SQL_USER:?Set the operator-selected SQL login}"
SQL_AUTH=(-U "$SQLCMDUSER")
# Connect to the selected database using the chosen authentication
sqlcmd -S "$SQL_SERVER" "${SQL_AUTH[@]:?Select authentication first}" -d "$SQL_DATABASE"
# Run a diagnostic script
sqlcmd -S "$SQL_SERVER" "${SQL_AUTH[@]:?Select authentication first}" -d master -i scripts/top-slow-queries.sql
# Run with output to file
sqlcmd -S "$SQL_SERVER" "${SQL_AUTH[@]:?Select authentication first}" -d master -i scripts/wait-stats.sql -o results.txt -s "," -W
-s "," separates columns; it does not produce quoted or escaped CSV.
SQL authentication requires a nonempty, exported SQLCMDPASSWORD provisioned outside
this agent session. If it is absent or empty, stop; never type a password into a prompt.
Re-run the setup before SQL-auth workflows if the environment has changed.
Go sqlcmd legacy startup reads ~/.sqlcmd/sqlconfig: a current basic-auth context
can overwrite an exported password when SQLCMDUSER is empty, before -U is
parsed. Exporting the selected login as SQLCMDUSER prevents that replacement;
-U alone does not. Do not inspect or change stored credentials to work around it.
[Initialization source](https://github.com/microsoft/go-sqlcmd/blob/a97013a80b01f3aaac4fb17e9ef422283
Установить SQL Server Skills в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл SQL Server Skills?
Comprehensive SQL Server performance diagnostics, index analysis, execution plan interpretation, query optimization, schema management, backup/restore, and monitoring using sqlcmd and T-SQL DMVs. Use when analyzing slow queries, investigating wait stats, finding missing indexes, reading execution plans, optimizing stored procedures or views, managing migrations, monitoring SQL Agent jobs, or diagnosing blocking/deadlocks on Microsoft SQL Server. Triggers on: SQL Server, MSSQL, sqlcmd, T-SQL performance, slow query, execution plan, DMV, missing index, wait stats, blocking, deadlock, stored procedure optimization, view tuning.
Как установить скилл SQL Server Skills?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл SQL Server Skills запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic