SQLSetDescField

 

System_CAPS_ICON_warning.jpg Warning

SQL Server Native Client (SNAC) is not supported beyond SQL Server 2012. Avoid using SNAC in new development work, and plan to modify applications that currently use it. The Microsoft ODBC Driver for SQL Server provides native connectivity from Windows to Microsoft SQL Server and Microsoft Azure SQL Database.

SQLSetDescField can be used to set descriptor fields for table-valued parameters and table-valued parameter columns. For information about the available fields, see Table-Valued Parameter Descriptor Fields and Descriptor Fields for Table-Valued Parameter Constituent Columns.

Table-valued parameter columns are only available when the descriptor header field SQL_SOPT_SS_PARAM_FOCUS is set to the ordinal of a record that has SQL_DESC_TYPE set to SQL_SS_TABLE. For more information about SQL_SOPT_SS_PARAM_FOCUS, see SQLSetStmtAttr.

If an attempt is made to set SQL_SOPT_SS_PARAM_FOCUS to the ordinal of a parameter that is not a table-valued parameter, SQLSetStmtAttr returns SQL_ERROR, and a diagnostic record is created with SQLSTATE = HY024 and the message "Invalid attribute value". SQL_SOPT_SS_PARAM_FOCUS is not changed when SQL_ERROR is returned.

Setting SQL_SOPT_SS_PARAM_FOCUS to 0 restores access to descriptor records for parameters.

For more information about table-valued parameters, see Table-Valued Parameters (ODBC).

Date/time features have been enhanced in ODBC. For information about the descriptor field provided for the new date/time types, see Parameter and Result Metadata.

For more information, see Date and Time Improvements (ODBC).

SQLSetDescField supports large CLR user-defined types (UDTs). For more information, see Large CLR User-Defined Types (ODBC).

SQLSetDecField can be used to set SQL_SOPT_SS_NAME_SCOPE in the application parameter descriptor (APD) to the values SQL_SS_NAME_SCOPE_EXTENDED and SQL_SS_NAME_SCOPE_SPARSE_COLUMN_SET.

For more information, see Sparse Columns Support (ODBC).

SQLSetDescField
ODBC API Implementation Details

Community Additions

ADD
Show: