sql server indexkey_property关键字
SQL语法:
INDEXKEY_PROPERTY ( object_ID ,index_ID ,key_ID ,property )
是表或索引视图的对象标识号。object_ID是int。
index_ID
是索引标识号。index_ID是int。
key_ID
是索引键列位置。key_ID是int。
property
是将返回其信息的属性的名称。property是一个字符串,可以是以下值之一。
在以下示例中,为索引 ID和表中的1
键列返回这两个属性。1
Production.Location
USE AdventureWorks2012;
GO
SELECT
INDEXKEY_PROPERTY(OBJECT_ID(‘Production.Location‘, ‘U‘),
1,1,‘ColumnId‘) AS [Column ID],
INDEXKEY_PROPERTY(OBJECT_ID(‘Production.Location‘, ‘U‘),
1,1,‘IsDescending‘) AS [Asc or Desc order];
结果集:
Column ID Asc or Desc order
----------- -----------------
1 0
(1 row(s) affected)
原文:https://www.cnblogs.com/SuJinTuan/p/14875442.html