create_table
Create a new SQL table in a Fabric Data Warehouse using a CTAS query. Provide a read-only SELECT or WITH statement as the source. Optionally specify clustering columns.
Instructions
Create a new SQL table via CTAS (CREATE TABLE AS SELECT).
Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
The service rejects SQL Analytics Endpoints with a ToolError.
CAUTION: select_body is executed verbatim as DDL on the warehouse.
Ensure the body matches the user's intent before calling this tool.
select_body must be a single read-only SELECT or WITH (CTE)
statement. The guard is always on and fail-closed: a write keyword
(DELETE, DROP, INSERT, etc.) or a semicolon anywhere in the body is
rejected, even inside a string literal or quoted identifier. If a
legitimate query body contains a write keyword (e.g. a column alias
'DELETE'), rewrite the expression to avoid the keyword.
When cluster_by is supplied, the DDL becomes
CREATE TABLE … WITH (CLUSTER BY ([c1], [c2])) AS SELECT ….
Column existence is not validated for CTAS because the result columns
come from the SELECT and are not known ahead of time.
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.
select_body: Single read-only SELECT or WITH (CTE) statement for the
CTAS source. Write keywords and semicolons are rejected
fail-closed, even inside string literals or quoted identifiers.
cluster_by: Optional list of column names for the CLUSTER BY clause
(up to 4).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | ||
| workspace | Yes | ||
| cluster_by | No | ||
| select_body | Yes | ||
| qualified_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||