dbo.fSQLSpecialColumns
This function retrieves column information for a specified table for the following:
The optimal set of columns that uniquely identifies a row in the table and columns that are automatically updated when any value in the row is updated by a transaction.
Syntax
dbo.fSQLSpecialColumns (<'database_qualifier' | null>, <'table_name' | null>, <'nullable' | null>)
Arguments
Returned Result Set
Example
This example creates a table with two columns that uniquely identify a row and are automatically updated when a transaction updates any value in the row.
CREATE TABLE t2 (c1 IDENTITY, c2 INTEGER, c3 SMALLINT NOT NULL, c4 TIMESTAMP NOT NULL)
ALTER TABLE t2 ADD PRIMARY KEY (c1, c4)
 
SELECT * FROM dbo.fSQLSpecialColumns ('Demodata' ,'t2' , 'null')
Result Set (abbreviated for space considerations):
COLUMN_NAME DATA_TYPE TYPE_NAME PRECISION LENGTH
=========== ========= ========= ========= ======
c1 4 INTEGER 4 4
c4 11 DATETIME 16 16
 
2 rows were affected.