| title | ODBC Table-Valued Parameter API Summary | ||
|---|---|---|---|
| description | ODBC Table-Valued Parameter API Summary | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.date | 01/26/2026 | ||
| ms.service | sql | ||
| ms.subservice | native-client | ||
| ms.topic | reference | ||
| helpviewer_keywords |
|
[!INCLUDE SQL Server Azure SQL Database Synapse Analytics PDW]
ODBC supports table-valued parameters (table‑valued parameters) through enhancements to several existing API functions. These functions work together to describe table‑valued parameter schemas, bind and transmit row sets, fetch metadata, and manage descriptor records.
The following sections organize the relevant ODBC functions into logical groups to help you understand how each part of the table‑valued parameter pipeline operates.
These functions help an application discover the structure of table-valued parameters, including column metadata, parameter definitions, and available SQL data types.
| Function | Purpose |
|---|---|
| SQLColumns | Retrieves column metadata for a table‑valued parameter or table type |
| SQLDescribeParam | Returns metadata for a table‑valued parameter parameter, including type, precision, and scale |
| SQLGetTypeInfo | Retrieves the SQL data types supported by the driver for table‑valued parameter columns |
| SQLPrimaryKeys | Provides information about key columns in table types used with table‑valued parameters |
| SQLProcedureColumns | Retrieves metadata for table‑valued parameter-related stored procedure parameters |
| SQLTables | Lists tables and table types available as sources for table‑valued parameter declarations |
These functions handle binding structured data to parameters, passing the data to the server, or streaming rows during execution.
| Function | Purpose |
|---|---|
| SQLBindParameter | Binds a table-valued parameter to an application buffer or rowset |
| SQLParamData | Retrieves the next part of a streamed table‑valued parameter parameter when using data-at-execution |
| SQLPutData | Sends table‑valued parameter data in chunks during data-at-execution operations |
These functions execute SQL statements that reference table‑valued parameters and manage the execution lifecycle.
| Function | Purpose |
|---|---|
| SQLExecDirect | Executes a SQL statement that uses table‑valued parameters without preparing it first |
| SQLExecute | Executes a previously prepared SQL statement that includes table‑valued parameter parameters |
Use these functions to manage descriptor fields and statement attributes required to describe rowsets and structured parameters correctly.
| Function | Purpose |
|---|---|
| SQLGetDescField | Retrieves descriptor metadata for table‑valued parameter columns or rowsets |
| SQLSetDescField | Sets descriptor metadata for table‑valued parameter columns or rowsets |
| SQLSetDescRec | Sets a full descriptor record for structured table‑valued parameter data |
| SQLGetStmtAttr | Retrieves statement attributes affecting table‑valued parameter execution behavior |
| SQLSetStmtAttr | Sets statement attributes such as rowset sizes or streaming flags for table‑valued parameter operations |
Use these functions to help your applications detect errors, warnings, or status messages during table‑valued parameter binding and execution.
| Function | Purpose |
|---|---|
| SQLGetDiagField | Retrieves diagnostic information generated during table‑valued parameter processing |