JiangLe

SQL Server 查看一个表上的索引

方法: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

   

 

分类:

技术点:

相关文章:

  • 2021-12-03
  • 2021-12-16
  • 2022-02-07
  • 2021-11-20
  • 2021-11-19
  • 2021-12-09
  • 2021-09-21
  • 2021-12-23
猜你喜欢
  • 2021-10-22
  • 2022-01-24
  • 2021-12-10
  • 2021-12-02
  • 2021-12-26
  • 2021-12-09
  • 2021-12-05
相关资源
相似解决方案