Documentation Index
Fetch the complete documentation index at: https://mintlify.com/A-Point-Systems-ltd/ms-sql-mcp/llms.txt
Use this file to discover all available pages before exploring further.
ReadData is the single entry point for every query that returns rows from the connected SQL Server or Azure SQL Database. Pass any valid read-only T-SQL SELECT statement — including queries against user tables, catalog views (sys.*), INFORMATION_SCHEMA, and dynamic management views — and receive the result set as an array of row objects keyed by column name.
ExecuteSQL explicitly rejects SELECT and read-only CTEs. Do not attempt to run queries through ExecuteSQL; always use ReadData for anything that reads data.
Parameter
A single read-only T-SQL statement. Both forms below are accepted:
- A plain
SELECTstatement. - A
WITH … SELECTCTE whose final statement is aSELECT(common table expressions).
SqlStatementClassifier before execution. Only one statement is allowed per call — batch separators (GO) and internal semicolons between statements are rejected.Routing rules — accepted vs. rejected
| Input | Verdict | Reason |
|---|---|---|
SELECT … | ✅ Accepted | Standard read-only query. |
WITH cte AS (…) SELECT … | ✅ Accepted | CTE that culminates in a SELECT. |
SELECT … INTO #tmp | ❌ Rejected | SELECT … INTO writes a new table; use ExecuteSQL. |
WITH cte AS (…) INSERT … | ❌ Rejected | Mutating CTE; use ExecuteSQL. |
INSERT / UPDATE / DELETE / MERGE | ❌ Rejected | DML; use ExecuteSQL. |
CREATE / ALTER / DROP / TRUNCATE | ❌ Rejected | DDL; use ExecuteSQL. |
EXEC / EXECUTE | ❌ Rejected | Procedural; use ExecuteSQL. |
Two statements separated by ; | ❌ Rejected | Only a single statement is allowed. |
ReadData returns:
SELECT is mistakenly submitted to ExecuteSQL, that tool returns:
Returns
Array of row objects. Each object is a dictionary keyed by the column name as it appears in the result set (column alias if specified, otherwise the column name from the source table or expression).
Usage notes
Column names in the result are taken directly from the SQL Server result-set metadata. If a query selects two columns with the same name (common with
SELECT * joins), the later column’s value overwrites the earlier one in the row dictionary. Use explicit column aliases to avoid collisions.Examples
Query system catalog — list tables modified today
Query sys.tables
Response
CTE query example
NULL values in response
SQLNULL database values are serialized as JSON null: