表の索引文の表示

635 ワード

SELECT  object_name(object_id) tableName,name,type_desc from sys.indexes
SELECT       =a.name  
,  =c.name  
,     =d.name  
,      =d.colid  
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='Person' --      
ORDER BY   c.name,a.name,d.name