Returns the column name.
Parameter |
Description |
---|---|
table-id |
The object ID of the table. |
column-id |
The column ID of the column. |
database-id |
The database ID. |
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