Retrieves this information about columns within a specified table or view:
The optimal set of columns that uniquely identifies a row in the table or view
The columns that are automatically updated when any value in the row is updated by a transaction
sp_special_columns table_name [, table_owner] [, table_qualifier] [, col_type]
is the name of the table. Wildcard-character search patterns are not supported.
is the owner of the table. Wildcard-character search patterns are not supported.
is ignored. Leave blank or set to NULL.
is a value that requests information about columns of a specific type:
“R” returns information about columns with values that uniquely identify any row in the table.
“V” returns information about columns with values that are automatically generated by a target each time a row is inserted or updated.
This procedure corresponds to the ODBC function SQLSpecialColumns.
See Table 11-1 for ODBC datatypes and matching ODBC integer identifiers returned in the TYPE_NAME and DATA_TYPE columns of the result set.