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.
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:
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!