INDEXKEY_PROPERTY

Transact-SQL Reference

Transact-SQL Reference

INDEXKEY_PROPERTY

Returns information about the index key.

Syntax

INDEXKEY_PROPERTY ( table_ID , index_ID , key_ID , property )

Arguments

table_ID

Is the table identification number. table_ID is int.

index_ID

Is the index identification number. index_ID is int.

key_ID

Is the index column position. key_ID is int.

property

Is the name of the property for which information will be returned. property is a character string and can be one of these values.

Value Description
ColumnId Column ID at the key_ID position of the index.
IsDescending Order in which the index column is stored.

1 = Descending
0 = Ascending


Return Types

int

Examples
SELECT indexkey_property(OBJECT_ID('authors'),2,2,'ColumnId')

SELECT indexkey_property(OBJECT_ID('authors'),2,2,'IsDescending')