sqldw-cli

Executes T-SQL against Fabric Warehouses, Lakehouse SQL endpoints, and Mirrored Databases via MCP.

1.1k|301|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/microsoft/skills-for-fabric --skill sqldw-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqldw-cli
Source: https://github.com/microsoft/skills-for-fabric/tree/main/plugins/fabric-skills/skills/sqldw-cli
Command: npx skills add https://github.com/microsoft/skills-for-fabric --skill sqldw-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working with Microsoft Fabric SQL endpoints requires knowing which T-SQL surface area each item type supports, resolving workspace and item GUIDs, and respecting MCP tool limits like the 10,000-row cap and single-batch rule. This Skill routes each request to the right mode (authoring, consumption, or operations) and enforces the correct constraints so queries and DDL actually succeed.

Core Features & Use Cases

  • Warehouse authoring: Create tables, run DML, ingest data with COPY INTO or OPENROWSET, manage transactions, and use time travel on Fabric Warehouses.
  • Read-only querying: Run SELECT, row counts, aggregations, and schema discovery against Warehouses, Lakehouse SQL analytics endpoints, and Mirrored Databases.
  • Performance diagnostics: Triage slow queries, pressure windows, cache warmth, and cluster key candidates using the queryinsights views.
  • Use Case: Ask "Which queries are slowest in my warehouse this week?" and the Skill resolves the workspace and item IDs, runs the queryinsights diagnostic queries, and reports cited figures.

Quick Start

Ask the assistant to count the rows in a table in your Fabric warehouse, providing the workspace and warehouse name.

Frequently Asked Questions about sqldw-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query a Fabric Lakehouse SQL endpoint from the CLI?

Resolve the workspace ID and the lakehouse's SQL analytics endpoint ID (properties.sqlEndpointProperties.id, not the lakehouse item ID) via az rest, then call the fabric-sqlendpoint-execute_query MCP tool with a single T-SQL batch. Use TOP or WHERE to stay under the 10,000-row result cap.

How do I load data into a Fabric Warehouse with COPY INTO?

Run COPY INTO through the fabric-sqlendpoint-execute_query MCP tool, pointing at ADLS Gen2 or OneLake files with the appropriate FILE_TYPE and credentials. COPY INTO is Warehouse-only; Lakehouse SQL endpoints and Mirrored Databases are read-only for table data.

Can I run INSERT or UPDATE on a Lakehouse SQL analytics endpoint?

No. Lakehouse SQL analytics endpoints and Mirrored Databases are read-only for table data; only views, functions, procedures, and schemas can be authored there. Table DDL and DML require a Fabric Warehouse item.

Why does my query return exactly 10,000 rows?

The MCP execute_query tool truncates results at 10,000 rows, so exactly 10,000 rows means the output was cut off. Add TOP N, WHERE filters, or aggregations, and use COUNT(*) to check the true total.

Why do I get 'Invalid object name queryinsights' errors?

The queryinsights views take about two minutes to appear on a newly created warehouse, and reading them requires Contributor or higher on the workspace. Data also appears with up to a 15-minute delay after queries complete.

When should I use sqlcmd instead of the MCP tool for Fabric SQL?

Only as a documented legacy fallback when the fabric-sqlendpoint-execute_query MCP tool is not registered in your environment. The MCP tool is the primary path; sqlcmd and GO separators are otherwise not supported.