sqldb-cli

Manages Fabric SQL databases via sqlcmd for T-SQL authoring, querying, and performance diagnostics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working with a SQL database in Microsoft Fabric requires juggling endpoint discovery, Entra authentication, T-SQL authoring, and OLTP performance diagnostics across many tools. This Skill gives an AI assistant the exact commands, references, and workflows to create schemas, run read-only queries, and investigate slow or blocked queries against a Fabric SQL database without guesswork.

Core Features & Use Cases

  • Schema and Data Authoring: Create tables, constraints, indexes, vector columns, temporal tables, and deploy dacpac files with SqlPackage, executing real DDL/DML through sqlcmd.
  • Read-Only Querying: Run SELECT queries, catalog exploration, vector similarity search, temporal queries, and JSON processing against the OLTP or SQL analytics endpoint.
  • Performance Diagnostics: Investigate Query Store data, blocked sessions, regressed plans, wait statistics, and CPU/IO pressure, with optional Extended Events sessions for intermittent blocking.
  • Use Case: A user asks "Which queries regressed in the last day?" The Skill selects operations mode, runs Query Store comparison queries against the OLTP endpoint, and reports the regressed queries with duration change percentages.

Quick Start

Ask the assistant to create an Orders table with a foreign key to Customers in your Fabric SQL database, or to find the five nearest embeddings to a given vector.

Frequently Asked Questions about sqldb-cli

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

FAQPage Schema
How do I run T-SQL queries against a SQL database in Microsoft Fabric?

Use the Go version of sqlcmd with the -G flag for Entra ID authentication, connecting to the discovered TDS endpoint with -S for the server FQDN and -d for the database name. Discover the endpoint through the Fabric REST API rather than hardcoding it.

How do I diagnose slow queries in a Fabric SQL database?

Start with volatile query detection using the coefficient of variation in Query Store, then run wait category analysis to classify the root cause as locking, CPU, IO, or memory. Check auto-tuning recommendations before manually creating any indexes.

What is the difference between the SQL database endpoint and the SQL analytics endpoint in Fabric?

The SQL database endpoint is the OLTP engine supporting live data, vector search, stored procedures, Query Store, and DMVs. The SQL analytics endpoint is a read-only replicated copy suited for cross-database queries and heavy analytics, but it lacks Query Store, DMVs, and security policy enforcement.

Can I use SQL authentication with a Fabric SQL database?

No, SQL authentication and CREATE LOGIN are not supported. You must use Microsoft Entra ID authentication, typically via sqlcmd -G with an authenticated Azure CLI session using ActiveDirectoryDefault.

Why is my table or column missing from the SQL analytics endpoint?

Tables with vector or json columns, unsupported primary key types, or databases exceeding 1000 tables are not mirrored to OneLake. Computed columns and LOB data over 1 MB are also skipped or truncated, so query the OLTP endpoint for those.

When should I use sqldb-cli versus sqldw-cli in Fabric?

Use sqldb-cli only for a Fabric SQL database item, which is the OLTP SQL Server engine. Warehouses, Lakehouse SQL endpoints, and mirrored databases belong to sqldw-cli, and notebook cells belong to spark-cli.