Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Mar 17, 2009

Rebuild All Table Indexes in a SQL Server Database with One Command

You can use the sp_MSforeachtable undocumented stored procedure to rebuild all indexes in your database. The command iterates through all the tables in a database. It's best to schedule this so it executes only during CPU idle time and at slow production periods:


sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')"
Srinath MS
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap