Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Query to Rebuild Indexes on SQL Server 2000 Database Expand / Collapse
Author
Message
Posted Wednesday, April 20, 2011 4:26 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 10:26 PM
Points: 56, Visits: 183
Hi,

Can anyone please let me know the query to rebuild all the indexes in an SQL Server 2000 Database??
I need to rebuild all the indexes in database at a time using single query.

Thanks in advance,
Vamshi.
Post #1096678
Posted Wednesday, April 20, 2011 9:36 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:27 PM
Points: 7,107, Visits: 12,657
You posted in a SQL 2008 forum. Not that you won't receive help, but you may have better luck posting your question in one of the SQL 2000 forums.

http://www.sqlservercentral.com/Forums/Group406.aspx




__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1096720
Posted Wednesday, April 20, 2011 11:34 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: 2 days ago @ 3:43 PM
Points: 39,866, Visits: 36,206
No need to post yet again. I've asked the mod to move the thread.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1096751
Posted Thursday, April 21, 2011 6:17 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, September 5, 2014 2:49 AM
Points: 1,155, Visits: 4,643
vamshi.sql (4/20/2011)
Hi,

Can anyone please let me know the query to rebuild all the indexes in an SQL Server 2000 Database??
I need to rebuild all the indexes in database at a time using single query.

Thanks in advance,
Vamshi.


Vamshi,
You can get the script here.

SQL server 2000 Index rebuild script


Muthukkumaran Kaliyamoorthy

Helping SQL DBAs and Developers >>>SqlserverBlogForum
Post #1096927
Posted Wednesday, October 31, 2012 9:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 25, 2013 6:30 AM
Points: 3, Visits: 7
I found this useful bit of code :

Run the following script changing the xxx for the database name, run against master.

SELECT 'dbcc dbreindex(''xxxxxxx.DBO.' +name+ ''')'
FROM sysobjects WHERE xtype='U'

This will generate a rebuild statement for each index, copy the output from the results window and paste it to the QueryAnalyzer window and run against the right database. This can obviously be repeated for each database as required.
Post #1379409
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse