TSQL To Find Fragmented Indexes
Prior to the Database Health Reports with the Fragmented Indexes Report, I used the following query to track down fragmented indexes.
SELECT ps.avg_fragmentation_in_percent, name FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS ps INNER JOIN sys.indexes AS idxs ON ps.OBJECT_ID = idxs.OBJECT_ID AND ps.index_id = idxs.index_id
But now it is so much easier with the Database Health Reports with the Fragmented Indexes Report.
Enroll Today!
![SteveStedman5](http://databasehealth.com/wp-content/uploads/2021/10/DHMimage1-1.png)
![SteveStedman5](https://stevestedman.com/wp-content/uploads/2021/03/button-16.png)
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!
Leave a Reply