Displays the name of the indexed column in the specified table or view to a maximum of 255 bytes in length.
index_col(object_name, index_id, key_#[, user_id])
declare @keycnt integer select @keycnt = keycnt from sysindexes where id = object_id("t4") and indid = 1 while @keycnt > 0 begin select index_col("t4", 1, @keycnt) select @keycnt = @keycnt - 1 end
index_col returns NULL if object_name is not a table or view name.
Transact-SQL Users Guide
sp_helpindex in Reference Manual: Procedures
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute index_col.