I am trying to manage the fragmentation of tables and indexes in a database. Following the example in BOL, I created a script that runs the command DBCC SHOWCONTIG WITH FAST, TABLERESULTS, ALL_INDEXES and saves the results to a table. Then it runs either DBREINDEX or DBCC INDEXDEFRAG depending on the level of logical fragmentation.
The mystery is this.....
For some tables, the logical fragmentation reported with DBCC SHOWCONTIG WITH FAST, TABLERESULTS, ALL_INDEXES differs from the value returned from DBCC SHOWCONTIG(<tablename>. Also, executing DBREINDEX appears to be having no affect on the results returned from DBCC SHOWCONTIG for the whole database.
Any thoughts on what is happening here?
Gordon Pollokoff
"Wile E. is my reality, Bugs Bunny is my goal" - Chuck Jones