获取SQL Server数据库中的聚簇索引信息

2014-11-16 0 757
获取SQL Server数据库中的聚簇索引信息
SELECT t.NAME [表名]
	,ix.NAME [聚簇索引名称]
	,c.NAME [聚簇索引包括字段]
FROM sys.indexes ix
INNER JOIN sys.tables t ON ix.object_id = t.object_id
	AND ix.type_desc = 'CLUSTERED'
	AND t.type = 'U'
INNER JOIN sys.index_columns ic ON ic.index_id = ix.index_id
	AND ix.object_id = ic.object_id
INNER JOIN sys.columns c ON ic.column_id = c.column_id
	AND ic.object_id = c.object_id
ORDER BY [表名]  

遇见资源网 sql 获取SQL Server数据库中的聚簇索引信息 http://www.ox520.com/17369.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务