execute_query
Execute read-only SELECT queries against SQL Server databases, with configurable row limits and database selection for controlled data retrieval.
Instructions
Execute a read-only SELECT query against the SQL Server. Only SELECT statements (and CTEs using WITH) are permitted. Use TOP or FETCH NEXT in your query for large tables to avoid excessive data transfer. Results are capped at 1000 rows by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SELECT query to execute | |
| database | No | Database to run the query against (defaults to the configured default database) | |
| max_rows | No | Maximum number of rows to return (default: 1000, max: 5000) |