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,Have a look at the samples in BooksOnLine under DBCC SHOWCONTIG.
Andrew J. Kelly SQL MVP
"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,
>|||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.
No comments:
Post a Comment