首页 > 数据库技术 > 详细

SQL Server 查看一个表上的索引

时间:2014-10-21 19:07:32      阅读:286      评论:0      收藏:0      [点我收藏+]

方法:1

      sys.indexes

      index_id =0:堆

      index_id =1:聚集索引

      index_id =2.....:非聚集索引

-------------------------------------------------------------------------------------

例子:

create table Student(
ID int not null,
Name nvarchar(16),
Major nvarchar(16));
go

create index ix_for_Student_ID
on dbo.student(ID);
go

create clustered index ix_clu_for_Student_Name
on dbo.Student(Name);
go

select OBJECT_NAME(ix.object_id),ix.index_id,ix.name from sys.indexes as ix
where ix.object_id = object_id(‘Student‘);
go

   bubuko.com,布布扣

 

SQL Server 查看一个表上的索引

原文:http://www.cnblogs.com/JiangLe/p/4040866.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!