Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I Re Index All tables in One Go? 1

Status
Not open for further replies.

u104741

MIS
Aug 26, 2003
94
GB
Sorry if the ansers is on here.. I have looked!!

I want a SQL Sript that i can run in Query Analysier that will re-index all my existing indexs in all tables in a database.. i am aware of the dbreindex command but is there one I can use that I dont have to specifiy each table??

Hope that makes sense...

Cheers,
JJ.
 
You can try:
Code:
sp_msforeachtable 'dbcc dbreindex(''?'')'
... but be careful. It may take long time to finish.

------
Math problems? Call 0800-[(10x)(13i)^2]-[sin(xy)/2.362x]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top