« Reverse Charge VAT Go-ahead to Beat Carousel Fraud | Main | Work and Families Act 2006 »

October 10, 2006

Data Fragmentation in SQL Server 2005

Current commands for index management, as supported in SQL 2000 and discussed previously, are still supported in SQL 2005. However, they will be phased out & are unlikely to be supported in future releases.

With this in mind it is probably worth mentioning a few of the successors:

DBCC SHOWCONTIG - this has been replaced by the sys.dm_db_index_physical_stats ( ) function.
e.g.
SELECT * FROM sys.dm_db_index_physical_stats(DB_ID(N'Database Name'), OBJECT_ID(N'Table Name'), NULL, NULL , 'LIMITED')

DBCC DBREINDEX - this is now dealt with using the ALTER INDEX statement.
e.g.
ALTER INDEX ALL ON Table Name REBUILD WITH (FILLFACTOR = 80, SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = OFF)

As a final point to mention, there are quite a few parameter options and switches that go along with these new methods. It's therefore advisable to do some research into what is actually available so that you can refine your use of these methods accordingly. SQL Server Books Online is always a good one but you'll find generally find detailed information anywhere on the internet.

Oliver Cox

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/797422/6372585

Listed below are links to weblogs that reference Data Fragmentation in SQL Server 2005:

Comments

Post a comment

Comments are moderated, and will not appear on this weblog until the author has approved them.

View blog reactions | Add to del.ico.us