E-Mail:
Author Avatar

Now Rebuild Indexes Online In SQL Server 2005!

Today I was looking for a “better way” to rebuild indexes in SQL Server 2005 and to minimize blocking\contention in the database. As I was looking through BOL I came across the ALTER INDEX statement. If you want to rebuild all indexes on a specified table you can run the following code:

ALTER INDEX ALL ON Customer
REBUILD WITH(ONLINE = ON)

If you want to rebuild a specific index on a table you can run the following:

ALTER INDEX idx_customer_name ON Customer
REBUILD WITH(ONLINE = ON)

For more information about the ALTER INDEX statement in SQL Server 2005 visit this site: Alter Index details

What Do You Think?

 


Anti-Spam Image

Want to Start a Blog Here for Free?

Are you an expert in one subject or another? If your goal is to help others and dispense hard-earned information back to the community, stake a claim on your very own Lockergnome blog today! You can write about anything - no matter the topic. Sign-up to start blogging!

Author Avatar
Administration - Jan 2, 2008

Reporting Services On A Cluster

Author Avatar
Programming - Dec 14, 2007

Victim Of Parameter Sniffing?