qq605490312
 
-- 查询一个数据库表中的索引及索引列
use [DB]
GO
SELECT  indexname = a.name , tablename = c. name , indexcolumns = d .name , a .indid
FROM    sysindexes a JOIN sysindexkeys b ON a .id = b .id  AND a .indid = b.indid
        JOIN sysobjects c ON b .id = c .id
        JOIN syscolumns d ON b .id = d .id  AND b .colid = d .colid
WHERE   a .indid NOT IN ( 0 , 255 )  
and   c.xtype=\'U\'  -- and   c.status>0 -- 查所有用户表
--AND c .name = \'nfms_recieve_ChaPianXL\' --查指定表
ORDER BY c. name ,
        a.name ,
        d.name

 

 

 

分类:

技术点:

相关文章:

  • 2021-11-11
  • 2021-11-11
  • 2021-11-21
  • 2021-09-28
  • 2021-09-28
  • 2020-05-23
猜你喜欢
  • 2021-11-11
  • 2021-11-11
  • 2021-11-11
  • 2021-11-11
  • 2021-07-20
  • 2021-09-27
  • 2021-11-11
相关资源
相似解决方案