Returns the column name.
COL_NAME ( table-id, column-id [ , database-id ] )
table-id The object ID of the table
column-id The column ID of the column
The following statement returns the column name lname. The object ID of the Customers table is 100209, as returned by the OBJECT_ID function. The column ID is stored in the column_id column of the syscolumn system table. The database ID of the iqdemo database is 0, as returned by the DB_ID function.
SELECT COL_NAME( 100209, 3, 0 ) FROM iq_dummy
The following statement returns the column name city.
SELECT COL_NAME ( 100209, 5 )FROM iq_dummy