Home All Groups Group Topic Archive Search About
Author
26 Jan 2006 9:21 PM
Joe K.
I would like to re-index two tables (t1 and t2) if the logical scan
fragmentation is greater 80% on these tables.

Please help me create a t-sql script to create this task. 

Thank You,

Author
27 Jan 2006 12:49 AM
Andrew J. Kelly
Have  a look at the samples in BooksOnLine under DBCC SHOWCONTIG.

--
Andrew J. Kelly  SQL MVP


Show quote
"Joe K." <Joe K*@discussions.microsoft.com> wrote in message
news:E1AF96CD-2AC5-4BDB-AF79-43CAD668A773@microsoft.com...
>I would like to re-index two tables (t1 and t2) if the logical scan
> fragmentation is greater 80% on these tables.
>
> Please help me create a t-sql script to create this task.
>
> Thank You,
>
Author
27 Jan 2006 9:27 PM
Tejas Parikh
DBCC Showcontig will give you the information on how fragmented etc. is your
table.
You can use DBCC Reindex to Reindex your tables(TABLES WILL BE OFFLINE).
You can also use DBCC Defrag to defrag your tables(It's an online process).
Also, it'll grow your logfile like anything if your tables are huge. So,
Beware.

AddThis Social Bookmark Button