Syntax of INDEX_COL Function :
INDEX_COL ( 'table', index_id, key_id )
table is a name of the table.
index_id is an id of the index.
key_id is an id of the key.
Return type of INDEX_COL function is nvarchar(256).
Examples of INDEX_COL Function :
Example 1 : Use of INDEX_COL function in select clause
SELECT INDEX_COL('Customers', 1, 1)
Output
CustomerID
Above example returns column name which is indexed in customers table.