Collect Index defragmentation

I do it for registered servers:

 

Index fragmentation with table row count and index creation and modification date

You can often check the index defragmentation. It is useful if you start checking with the biggest table, because the biggest effect is there.
I like to check the indexes with the creation and modification date. If you rebuild the index your index modification date will be updated.

If you want to see for all database you can replace the

  • DB_ID()
  • with

  • NULL
  • in the script.