Script to find the Fragmentation of indexes
Below is the script to find the fragmentation of the indexes created on a database.
SELECT OBJECT_NAME(OBJECT_ID), index_id,index_type_desc,index_level,
avg_fragmentation_in_percent,avg_page_space_used_in_percent,page_count
FROM sys.dm_db_index_physical_stats (DB_ID( N'Database name')...
2015-01-07 (first published: 2015-01-04)
7,209 reads