索引查看
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;