nav2009-sql-performancelisted
Install: claude install-skill whobat/AI-Agent-skills
# NAV 2009 SQL Performance Triage
> Targets **SQL Server instances hosting Dynamics NAV 2009 databases**. 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 and never calls an LLM.
`SCRIPT` = this skill's `scripts/Invoke-SqlPerfTriage.ps1`. Requires **PowerShell 7+** (`pwsh`)
and network access to the SQL Server. The full SQL-finding → NAV-action interpretation guide is in
[REFERENCE.md](REFERENCE.md) — read it before writing your analysis.
## Permissions & auth
- Default is **Windows integrated auth** (the user running `pwsh`). Pass `-SqlCredential` for SQL auth —
it is a `PSCredential`, so let PowerShell prompt (`-SqlCredential (Get-Credential)`); never put a
password on the command line.
- Needs **VIEW SERVER STATE** on the instance and **VIEW DATABASE STATE** (or `db_owner`) in the NAV
database. The trace-flag sub-check may need sysadmin and degrades gracefully if denied.
- Connections are unencrypted by default (NAV 2009-era instances rarely have TLS certs); add `-Encrypt`
if the instance supports it.
## How to run
Always run with `pwsh`. Parse the JSON it prints on stdout.
| Want | Pass |
|------|------|
| **Full snapshot of a NAV DB** | `-ServerInstance SQLSRV01 -Database 'NAV_PROD'` |
| **Named instance** | `-ServerInstance 'SQLSRV01\NAV'` |
| **Server-level only (no DB)** | omit `-Database` (D