Table structure
get_table_schemaRetrieve the full structure of a table or view: columns, types, constraints, and indexes, to learn exact column names and types before querying. For view SQL text, use get_view_definition.
Instructions
Returns the full structure of one table or view: columns with an unambiguous type_declaration (such as 'nvarchar(250)'), max_length_chars, every extended property, computed-column definitions and whether they are persisted; plus primary key, foreign keys, check and unique constraints, and indexes with key column order and declared key width. Call it before query_table to learn exact column names and types; for a view's SQL text use get_view_definition. max_length is the raw sys.columns value in BYTES, so reason about text length with type_declaration or max_length_chars.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name, bare, with no schema prefix. Example: 'GenericSecurity' | |
| schema | No | Table schema. Empty searches every schema. Example: 'Feeder' | |
| database | Yes | Name of the database as registered in the configuration. |