2005 Clean Indexes For All Databases on a Server

  • Comments posted to this topic are about the item 2005 Clean Indexes For All Databases on a Server

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Good work Grant. You could probably tune a little bit more for example specifying the page_count limit in the clause and modify the line from

    SELECT @command = ''ALTER INDEX '' + @indexname + '' ON ?.'' + @schemaname + ''.'' + @objectname + '' REORGANIZE'';

    to

    SELECT @command = ''ALTER INDEX ['' + @indexname + ''] ON ?.['' + @schemaname + ''].['' + @objectname + ''] REORGANIZE'';

    Same for rebuild..Thanks again - will probably use this at some point

    __________________________
    Allzu viel ist ungesund...

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply