Read Table Rows
mssql_read_table_rowsRead rows from a SQL Server table with column selection, WHERE filtering, ORDER BY, and pagination. Pass parameters safely via @paramName placeholders.
Instructions
Returns rows from a table with optional column projection, WHERE filtering, ORDER BY, and pagination. Read-only. Table and schema names are validated as safe identifiers. WHERE clause values MUST be passed via 'parameters' using @paramName placeholders. Pagination: limit (1-200, default 20) and offset. Example: tableName='Orders', schemaName='dbo', columns=['OrderId','Total'], limit=50
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows (1-200) | |
| offset | No | Rows to skip | |
| columns | No | Columns to return (default: all) | |
| orderBy | No | ORDER BY expression. Example: 'CreatedAt DESC, Id ASC' | |
| tableName | Yes | Table name | |
| parameters | No | Values for WHERE clause @paramName placeholders | |
| schemaName | No | Schema name (default: dbo) | dbo |
| whereClause | No | WHERE predicate without WHERE keyword. Use @paramName for all values. Example: 'Status = @status AND Amount > @minAmount' | |
| response_format | No | Output format: 'json' for structured data, 'markdown' for human-readable table | json |