Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

2005 Clean Indexes For All Databases on a Server Expand / Collapse
Author
Message
Posted Sunday, September 23, 2007 10:59 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 4:11 PM
Points: 15,646, Visits: 28,027
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #401633
Posted Wednesday, March 2, 2011 3:00 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, June 6, 2014 2:18 PM
Points: 843, Visits: 2,559
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...
Post #1071794
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse