SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Yet another way to defrag indexes

By Gaby Abed,

Lovingly modified from example D in the world famous dm_db_index_physical_stats books online entry.

By putting the script in an query that can be executed, it lets me pass database names to it, without having to create the proc in each DB.  Feel free to play with the defaults, but these seem to work for us.  Because these are very critical online systems, I have decided to keep the ONLINE=ON setting by default.  But because there are tables that may have column types that can't be built online, such as text or XML, then a TRY/CATCH block switches it to OFF.

Total article views: 2273 | Views in the last 30 days: 2
Related Articles

Online testing sql server...

online testing sql server...


Filegroup online backup and restore

online ...but online at all time :-)


TechEd Online

 I'm glad I'm not this slow, or maybe it's timed for the SQL Server release, but my TechEd Online pa...


Trusting Online

How do you earn trust online? How do you decide who to trust? Steve Jones comments a bit about this ...


checking database online or not

checking database online or not