2、columnproperty
作用:返回有关列或过程参数的信息。
实例:
USE AdventureWorks;
GO
SELECT COLUMNPROPERTY( OBJECT_ID('Person.Contact'),'LastName','PRECISION')AS 'Column Length';
GO
5、indexproperty
作用:据指定的表标识号、索引或统计信息名称以及属性名称,返回已命名的索引或统计信息属性值
实例:
USE AdventureWorks;
GO
SELECT
INDEXPROPERTY(OBJECT_ID('HumanResources.Employee'),
'PK_Employee_EmployeeID','IsClustered')AS [Is Clustered],
INDEXPROPERTY(OBJECT_ID('HumanResources.Employee'),
'PK_Employee_EmployeeID','IndexDepth') AS [Index Depth],
INDEXPROPERTY(OBJECT_ID('HumanResources.Employee'),
'PK_Employee_EmployeeID','IndexFillFactor') AS [Fill Factor];
GO
6、indexkey_property
作用:返回有关索引键的信息
实例:
USE AdventureWorks;
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];
GO