SQLSetDescFieldSQLSetDescField

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse

SQLSetDescField 可用于为表值参数和表值参数列设置描述符字段。SQLSetDescField can be used to set descriptor fields for table-valued parameters and table-valued parameter columns. 有关可用字段的信息,请参阅 表值参数描述符字段Table-Valued 参数构成列的描述符字段For information about the available fields, see Table-Valued Parameter Descriptor Fields and Descriptor Fields for Table-Valued Parameter Constituent Columns.

备注Remarks

表值参数列仅在将描述符标头字段 SQL_SOPT_SS_PARAM_FOCUS 设置为特定记录(其 SQL_DESC_TYPE 设置为 SQL_SS_TABLE)的序数时可用。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. 有关 SQL_SOPT_SS_PARAM_FOCUS 的详细信息,请参阅 SQLSetStmtAttrFor more information about SQL_SOPT_SS_PARAM_FOCUS, see SQLSetStmtAttr.

如果尝试将 SQL_SOPT_SS_PARAM_FOCUS 设置为不是表值参数的参数的序号,则 SQLSetStmtAttr 将返回 SQL_ERROR,并且将使用 SQLSTATE = HY024 和消息 "属性值无效" 创建诊断记录。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_ERROR 时,不更改 SQL_SOPT_SS_PARAM_FOCUS。SQL_SOPT_SS_PARAM_FOCUS is not changed when SQL_ERROR is returned.

将 SQL_SOPT_SS_PARAM_FOCUS 设置为 0 可以恢复对参数的描述符记录的访问权限。Setting SQL_SOPT_SS_PARAM_FOCUS to 0 restores access to descriptor records for parameters.

有关表值参数的详细信息,请参阅 ODBC)(表值参数 For more information about table-valued parameters, see Table-Valued Parameters (ODBC).

SQLSetDescField 对日期和时间增强功能的支持SQLSetDescField Support for Enhanced Date and Time Features

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.

有关详细信息,请参阅 ODBC)(日期和时间改进 For more information, see Date and Time Improvements (ODBC).

SQLSetDescField 对大型 CLR UDT 的支持SQLSetDescField Support for Large CLR UDTs

SQLSetDescField 支持 (Udt) 的大型 CLR 用户定义类型。SQLSetDescField supports large CLR user-defined types (UDTs). 有关详细信息,请参阅 ODBC)(的大型 CLR User-Defined 类型 For more information, see Large CLR User-Defined Types (ODBC).

SQLSetDescField 对稀疏列的支持SQLSetDescField Support for Sparse Columns

可以使用 SQLSetDecField 将应用程序参数描述符中的 SQL_SOPT_SS_NAME_SCOPE 设置 (APD) 到值 SQL_SS_NAME_SCOPE_EXTENDED 和 SQL_SS_NAME_SCOPE_SPARSE_COLUMN_SET。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.

有关详细信息,请参阅 稀疏列支持 (ODBC)For more information, see Sparse Columns Support (ODBC).

另请参阅See Also

SQLSetDescField SQLSetDescField
ODBC API 实现细节ODBC API Implementation Details