/microsoft-sql-admin:partitioned-tables [SchemaName] [TableName] [FutureMonths] [ScanMode] [MinPageCount]from Microsoft SQL administration
Analyzes partitioned tables for skew, hot partitions, boundary gaps, index fragmentation, partition elimination, and missing future partitions. Runs T-SQL diagnostics against SQL Server.
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.
Use this skill when the user asks about partitioned tables, partition health, partition skew, partition elimination, or table partitioning diagnostics. It covers:
SELECT @@SERVERNAME, DB_NAME(), SUSER_SNAME(), SERVERPROPERTY('EngineEdition')).sys.dm_db_index_physical_stats may take time on large tables.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. 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, give the
user the T-SQL to run and ask for the results.VIEW SERVER PERFORMANCE STATE (VIEW SERVER STATE before SQL Server 2022) or, on Azure
SQL Database, VIEW DATABASE PERFORMANCE STATE or ##MS_ServerStateReader##, plus any other read
permission these queries need. A tool is only as read-only as the login it connects with.| Parameter | Default | Description |
|---|---|---|
| SchemaName | dbo | Schema of the target partitioned table |
| TableName | (required) | Name of the target partitioned table. Steps 2–3 help discover candidates. |
| FutureMonths | 6 | How many months ahead to check for missing partitions in boundary health analysis |
| ScanMode | LIMITED | Fragmentation scan mode: LIMITED (fastest), SAMPLED, or DETAILED (most accurate but slowest) |
| MinPageCount | 1000 | Minimum page count for a partition to receive fragmentation maintenance recommendations |
| EngineEdition | Platform | Supported | Notes |
|---|---|---|---|
| 1 | Personal / Desktop Engine | Yes | Legacy; not available in SQL Server 2005+ |
| 2 | Standard | Yes | Standard, Developer, Web, BI editions |
| 3 | Enterprise | Yes | Enterprise, Developer, Evaluation editions |
| 4 | Express | Yes | Express editions |
| 5 | Azure SQL Database | Yes | Single-database scope, no cross-database queries |
| 6 | Azure Synapse Analytics (Dedicated SQL Pool) | No | Partitioning behavior differs significantly — stop here |
| 8 | Azure SQL Managed Instance | Yes | Instance-wide scope, most on-prem DMVs available |
| 9 | Azure SQL Edge | Yes | DMV behavior similar to SQL Server on-prem |
| 11 | Azure Synapse Serverless SQL Pool / Microsoft Fabric (non-SQL DB) | No | Partitioning DMVs not available — stop here |
| 12 | Fabric SQL Database | Yes | Behaves like Azure SQL Database (single-database scope) |
| other | SQL Server on-prem / IaaS | Yes | Full DMV access |
Execute Step 1 first, then Step 2. Once a target table is identified, run Steps 3+ with
{{SchemaName}} and {{TableName}} from the skill parameters.
Load and execute the Step 1 query from references/queries.md. If is_unsupported_platform = 1 (editions 6, 11), stop — this skill does not support Azure Synapse Dedicated SQL Pool (edition 6) or Azure Synapse Serverless SQL Pool / Microsoft Fabric non-SQL DB endpoints (edition 11).
| Finding | Recommendation |
|---|---|
is_unsupported_platform = 1 (engine edition 6 or 11) | Stop here — this skill is not designed for Azure Synapse Dedicated SQL Pool (edition 6) or Azure Synapse Serverless SQL Pool / Microsoft Fabric Warehouse (edition 11). Partitioning behavior differs significantly in these environments. |
engine_edition = 12 (Fabric SQL Database) | Behaves like Azure SQL Database — proceed with all steps. |
engine_edition = 9 (Azure SQL Edge) | Proceed — DMV behavior is similar to SQL Server on-prem. |
Load and execute the Step 2 query from references/queries.md. Use it to identify candidate tables, shared partition functions, and very large tables with too few partitions.
If no rows return, stop — the current database has no partitioned tables for this skill to analyze.
Load and execute the Step 3 query from references/queries.md for the chosen table. The key signal is IsPartitioned.
If the result is NO, stop the deeper workflow and report that the table is not partitioned.
Load and execute the Step 4 query from references/queries.md. Focus on PctOfTotal, SkewPct, SkewStatus, and EmptyFlag.
High skew, a dominant partition, or empty partitions indicate boundary design or merge opportunities.
Load and execute the Step 5 query from references/queries.md. Review avg_fragmentation_in_percent, page_count, and MaintenanceRecommendation per partition.
Escalate partitions marked REBUILD, REORGANIZE, or DISABLED INDEX; ignore tiny partitions below MinPageCount.
Load and execute the Step 6 query from references/queries.md. Look for missing future boundaries, uneven intervals, duplicate/off-by-one patterns, and a last boundary already in the past.
These are the main signals that the sliding-window design is drifting or about to fail on incoming data.
Load and execute the Step 7 query from references/queries.md only after confirming boundary gaps. The key outputs are GeneratedScript, BoundariesGenerated, and NewTotalPartitions.
If no script is returned, the table may already be covered or the partition function may not be date-based.
Load and execute the Step 8 query from references/queries.md. Focus on HeatStatus, Action, SkewVerdict, CoefficientOfVariation, and the top hot partitions.
HOT, EXTREME HOT, CRITICAL SKEW, and many empty partitions are strong signals to rebalance or merge.
Load and execute the Step 9 query from references/queries.md. Look for missing index recommendations, non-aligned indexes, and indexes that omit the partition column.
Misalignment or missing partition-column coverage can block partition switching and reduce partition elimination.
Load and execute the Step 10 query from references/queries.md. The key signals are HasPartitionedOperator, HasPartitionIdSeek, and Recommendation.
Flag active queries that scan partitioned objects without PartitionID seeks; that usually means partition elimination is not happening.
Load and execute the Step 11 query from references/queries.md. Review ReservedMB, UsedMB, CompressionType, and Recommendation per partition.
Large uncompressed partitions, empty partitions, or uneven storage growth usually point to compression or merge work.
Load and execute the Step 12 query from references/queries.md. Focus on read_ops, write_ops, and wait-driven recommendations for the hottest partition/index combinations.
Remember these DMV counters are cumulative since last restart, so use them as current pressure signals, not long-term history.
references/queries.md in this skill flow.sys.dm_db_index_physical_stats must inspect each partition.Format the final answer with the template in references/report-template.md.
Load the supporting SQL from references/queries.md and cite the step outputs that justify each recommendation.
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