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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defraging all indexs in a table

Status
Not open for further replies.

jeffmoore64

Programmer
Mar 23, 2005
207
US
Hi,
How do I defrag all of the indexs in a table? If I leave the index part of the dbcc indexdefrag statment off I get an error.
TIA
 
What version of SQL are you using. If this is 2005 your should not use DBCC INDEXDEFRAG use Alter Index. Also going forward it will not be supported. You are better off performing an ALTER INDEX (2005) DBCC DBREINDEX (2000)

Anyway,
Your syntax should look like this.

DBCC INDEXDEFRAG (0, 'table_name')

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top