May 11, 2010 at 10:30 pm
I am trying to write a script where if fragmentation is >= 30, then if the
large object (LOB) data types are: image, ntext, text, varchar(max), nvarchar(max), varbinary(max), and xml
then index rebuild will be done offline, else it will be done online.
And if the fragmentation >= 5, then index reorganize will be done.
I attached the script for review, as I am getting duplicate Alter index statements and also the output
is incorrect too.. Could you please advice.
Thanks.
May 12, 2010 at 12:36 am
Why reinvent the wheel? There's several good index rebuild scripts available, well tested and well used.
http://sqlfool.com/2010/04/index-defrag-script-v4-0/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply