/microsoft-sql-admin:create-xe-session [SessionName] [Purpose] [TemplateSessionName]from Microsoft SQL administration
Creates and configures Extended Events sessions on SQL Server and Azure SQL Database to capture slow queries, deadlocks, and blocking over hours or days.
Ships in Microsoft SQL administration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
deadlock-analysis-azuresql on Azure SQL Database or deadlock-analysis on SQL Server and Managed Instance.For Azure SQL Database (EngineEdition 5), read Azure-specific guidance before choosing diagnostic queries. It preserves the service-specific permissions, capture limitations and error interpretation. Keep this skill's scope and authorization rules; the reference is not a second workflow to run unconditionally.
For database_xml_deadlock_report, read participant clientapp, loginname, and statement evidence from the native deadlock XML. Event-level actions are not substitutes for participant attribution. Input buffers may be truncated and omit earlier transaction statements; collect additional evidence when needed. See the Azure deadlock guide.
When asked for a bounded design, distinguish supplied settings from proposed choices. For an event_file target, propose both a per-file size and a finite rollover count, state their approximate total storage bound, and specify a stop condition. Label these as proposals pending platform/permission checks; do not present them as observed settings or create the session without authorization. For a ring_buffer, bound memory and capture duration and explain that older events may be lost.
On Azure SQL Database use database-scoped sessions, views and permissions. Verify event availability and field units on the actual target. A successful CREATE/START does not prove the session will collect evidence: check the event, predicate, attribution actions and target, generate a harmless matching event if authorized, then read the target and confirm the expected row. Stop/drop only the session created for this task when finished, retaining the evidence first.
Do not prescribe SQL Server's blocked_process_report recipe unchanged for Azure SQL Database; use the supported Azure blocking diagnostic stream or database-scoped evidence described in the Azure reference. State what cannot be recovered retrospectively. Do not grant permissions or create storage credentials without authorization.
Use this skill when the user wants to:
This skill is an orchestration layer. All SQL and detailed templates live under references/.
microsoft-sql-admin plugin (mssql_list_database_connections,
mssql_connect_database, then mssql_execute_query); any other SQL tool the agent host provides
for running T-SQL and reading result sets;
sqlcmd from a terminal. Use it
for metadata discovery, session inspection, DDL execution, and verification. If the SQL Tools MCP
server is not connected or lists no connections, follow the sql-tools-mcp-setup skill, which
asks before installing or configuring anything. If no SQL tool can be made available, provide the
T-SQL for the user to review and run, then ask for the results.When a step names a file, read it from references/ relative to this SKILL.md before
executing the step.
Build this specification before rendering DDL:
purpose
session_name
template_session_name: optional
scope: SERVER | DATABASE
events[]
predicates[] per event
actions[] per event
target: event_file | ring_buffer
target_settings
session_options
start_now
startup_state
replace_existing
sensitive_data_notice
Ask only for information that cannot be derived from the request, platform, or template session. Do not make the user choose raw XE implementation details when the diagnostic intent is enough to make a safe recommendation.
Load references/step-0-platform-and-capabilities.md.
Determine:
Stop on unsupported or unknown platforms.
Load references/step-1-event-design.md.
Translate the user request into measurable signals, candidate event families, selective predicates, minimum necessary actions, target requirements, and a bounded capture lifecycle.
Run the XE metadata discovery queries before finalizing any event or predicate.
When TemplateSessionName is supplied, load
references/step-2-existing-session-template.md.
Inspect persisted configuration and, when running, events, predicates, actions, and targets from the XE dynamic management views. Do not read captured target data merely to create a template.
Create a new session name and revalidate every copied element.
Use the existing-session queries in the platform reference:
If the destination exists, report whether it is running and ask whether to preserve, clone, or replace it. Replacement requires explicit approval.
Load the platform-specific reference:
For SQL Server/MI, run the default-directory query in the platform reference before rendering an
event_file target. Use ring_buffer only for bounded short-term capture, explicit user choice,
or downstream compatibility.
After user authorization:
Load references/blocking-investigation-recipe.md when intermittent blocking requires passive monitoring.
Blocking is one reusable recipe, not the default behavior of this skill.
Load references/report-template.md and populate it with the final session specification and verified state.
created but stopped.references/azure-sql/guidance.md (opens in a new tab)references/azure-sql/references/event-file-to-blob-storage.md (opens in a new tab)references/azure-sql/references/sessions-that-capture-nothing.md (opens in a new tab)references/blocking-investigation-recipe.md (opens in a new tab)references/report-template.md (opens in a new tab)references/step-0-platform-and-capabilities.md (opens in a new tab)references/step-1-event-design.md (opens in a new tab)references/step-2-existing-session-template.md (opens in a new tab)references/step-3-sqlserver-session.md (opens in a new tab)references/step-4-database-session.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-sql-admin47 skills in this plugin
/active-connectionsUse when the user asks who is connected, which sessions are idle or hold the oldest open transaction, or how connections split by login or app. If a client can't connect, use `connectivity-troubleshoot`./always-encrypted-columnsUse when the user asks which plaintext columns can or should use Always Encrypted, or why a column is disqualified. Eligibility only: not for listing already-encrypted columns or their keys./authentication-diagnosticsUse when a login fails (18456, 'Login failed for user'), a user can't open a database, a permission is denied, or an Entra or managed identity login fails. For network errors, use `connectivity-troubleshoot`.Other plugins' skills for the same job