SELECTOBJECT_NAME(object_id) AS tblName,(SELECT name FROM sys.indexes WHERE object_id = a.object_id and index_id = a.index_id),avg_fragmentation_in_percentFROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, NULL) aWHERE avg_fragmentation_in_percent > 30AND index_type_desc IN('CLUSTERED INDEX', 'NONCLUSTERED INDEX')ORDER BY avg_fragmentation_in_percent DESC
Home
› Uncategorized
Post a Comment
Post a Comment