索引查看


SELECT  a.object_id ,
        OBJECT_NAME(a.object_id) AS TableName ,
        a.index_id ,
        name AS IndedxName ,
        avg_fragmentation_in_percent
FROM    sys.dm_db_index_physical_stats(DB_ID(N'WAP_WORKSHEET'),
                                       OBJECT_ID(N'WS_INST_STEP'), NULL, NULL,
                                       NULL) AS a
        INNER JOIN sys.indexes AS b ON a.object_id = b.object_id
                                       AND a.index_id = b.index_id;

 

posted @ 2019-08-19 17:22  山顶洞外人  阅读(184)  评论(0编辑  收藏  举报