返回有关索引键的信息。
INDEXKEY_PROPERTY ( table_ID , index_ID , key_ID , property )
table_ID
表标识号。table_ID 的数据类型为 int。
index_ID
索引标识号。index_ID 的数据类型为 int。
key_ID
索引列的位置。key_ID 的数据类型为 int。
property
属性的名称,将要为该属性返回信息。property 是字符串,可以是下面值中的一个。
Value | 描述 |
---|---|
ColumnId | 索引的 key_ID 位置上的列 ID。 |
IsDescending | 存储索引列的顺序。 1 = 降序 |
int
SELECT indexkey_property(OBJECT_ID('authors'),2,2,'ColumnId')
SELECT indexkey_property(OBJECT_ID('authors'),2,2,'IsDescending')