set_cluster_columns
Change or remove clustering columns on an existing table by rebuilding it in a single transaction, with automatic rollback on failure to protect data integrity.
Instructions
Change (or remove) the data-clustering columns of an existing table.
Rebuilds the table via a transactional CTAS-swap:
CREATE TABLE [schema].[__recluster_<hex>] [WITH (CLUSTER BY (...))] AS SELECT * FROM [schema].[orig]DROP TABLE [schema].[orig]EXEC sp_renameto restore the original name
All three steps run inside ONE transaction. Any failure rolls back automatically — no orphan temp table is left behind.
CAUTION: This operation copies the full table (runtime is proportional
to table size). Dependent views and stored procedures that reference
this table by name are NOT automatically updated by sp_rename and
may need refreshing after the swap.
Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
Args:
workspace: Workspace name or GUID.
item: Warehouse name or GUID. SQL Analytics Endpoints are rejected.
qualified_name: Dot-separated qualified table name, e.g. dbo.sales.
cluster_by: New list of column names for the CLUSTER BY clause
(up to 4). Pass null or an empty list to remove clustering
(rebuilds table without CLUSTER BY).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace": "<workspace>",
"item": "<item>",
"qualified_name": "<qualified_name>"
},
"name": "set_cluster_columns"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | ||
| workspace | Yes | ||
| cluster_by | No | ||
| qualified_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||