>In SQL 2000 (and still in SQL 2005 - but not being continued) DBCC SHOWCONTIG has been used to capture index statistics. With a cursor, all indexes of all tables (of all DBs) could have their stats extracted with one procedure.
>
>In SQL 2005, sys.dm_db_index_physical_stats is the recommended method. This gives the information differently. Wtih all arguments set to NULL, all of the index information can be selected without the need for a cursor. It gives database_id and object_id, though, not the names.
>
>My question is this: What would be the best way to have a procedure that uses
>
> ALTER INDEX ALL ON ... REORGANIZE and
> sys.dm_db_index_physical_stats
>
>to update all indexes (on all tables, and all DBs) that are more than 20% fragmented??
>
>Your help is greatly appreciated.
Not sure if this is helpful
http://204.9.76.233/Community/forums/t/2163.aspx
If it's not broken, fix it until it is.
My Blog