September 23, 2007 at 10:59 am
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
The Scary DBA Author of: SQL Server 2022 Query Performance Tuning, 6th Edition and SQL Server Execution Plans, 3rd Edition
Product Evangelist for Red Gate Software
March 2, 2011 at 3:00 am
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