sqlserver-perf-triagelisted
Install: claude install-skill whobat/AI-Agent-skills
# SQL Server Performance Triage
> Works against **any SQL Server instance** (2005 → current). The bundled script
> `scripts/Invoke-SqlPerfTriage.ps1` collects a **read-only** diagnostic snapshot and emits
> JSON; **the agent (you) writes the analysis.** The script never modifies server or database
> state.
`SCRIPT` = this skill's `scripts/Invoke-SqlPerfTriage.ps1`. Interpretation guide in
[REFERENCE.md](REFERENCE.md). This script is vendored identically in the NAV 2009 and AX 2012
sibling skills — if the target database belongs to one of those applications, prefer the
sibling skill for its application-specific interpretation.
## Permissions & auth
- Default is **Windows integrated auth**. Pass `-SqlCredential (Get-Credential)` for SQL auth —
never put a password on the command line.
- Needs **VIEW SERVER STATE** on the instance and **VIEW DATABASE STATE** (or `db_owner`) in the
target database. The trace-flag sub-check may need sysadmin and degrades gracefully.
- Connections are unencrypted by default; add `-Encrypt` if the instance has a valid certificate.
## How to run
Always run with `pwsh`. Parse the JSON it prints on stdout.
| Want | Pass |
|------|------|
| **Full snapshot of a DB** | `-ServerInstance SQLSRV01 -Database 'AppDB'` |
| **Named instance** | `-ServerInstance 'SQLSRV01\INST01'` |
| **Server-level only (no DB)** | omit `-Database` (DB-scoped sections report `skipped`) |
| **Only some sections** | `-Sections waits,blocking,deadlocks` |
| **SQL auth**