DBCC IndexDefrag

Download PDF

Being day 16 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC INDEXDEFRAG.

Description:

DBCC INDEXDEFRAG was used for to defragment indexes on SQL Server 2000, the same thing can be done with Alter Index on newer versions of SQL Server..

DBCC INDEXDEFRAG Syntax:

dbcc indexdefrag
(
    { 'database_name' | database_id | 0 }
    , { 'table_name' | table_id | 'view_name' | view_id }
    [ , { 'index_name' | index_id }
    [ , { partition_number | 0 } ] ]
)
    [ WITH NO_INFOMSGS ]

For more info on index defragmentation, check out the Database Health Reports application. Below is a sample screenshot of the Index Fragmentation report.

Index_Fragmentation_Report

Notes:

Note that DBCC INDEXDEFRAG was deprecated and replaced by ALTER INDEX.

For more information see TSQL Wiki DBCC indexdefrag.

DBCC Command month at SteveStedman.com is almost as much fun as conveyor belt sushi.

 

More from Stedman Solutions:

SteveStedman5
Steve and the team at Stedman Solutions are here for all your SQL Server needs.
Contact us today for your free 30 minute consultation..
We are ready to help!

Leave a Reply

Your email address will not be published. Required fields are marked *

*