RE: Index...

RE: Index...

 

  

Hi, all ,
I have better idea...

Try this , it simple & less code.

exec sp_MSforeachtable @command1="print '?' dbcc dbreindex ('?')"

KLSQLDBA
Freelance Database Administrator
Malaysia




--- "Herrera, Jorge" <[Email Address Removed] wrote: > Here is a way you
can do all of the reindex
>
> USE YourDBName
>
> DECLARE @TNAMEA varchar(35)
>
> DECLARE TablName CURSOR FOR (select name from sysobjects where (type = 'U'))
>
> OPEN TablName
> FETCH NEXT FROM TablName INTO @TNAMEA
>
> While (@@fetch_status = 0)
> BEGIN
>
> DBCC DBREINDEX (@TNAMEA)
> FETCH NEXT FROM TablName INTO @TNAMEA
>
> END
>
> CLOSE TablName
> DEALLOCATE TablName
> go
>
>
> I hope this helps.
> Jorge
>
> -----Original Message-----
> From: ikke ikke [mailto:[Email Address Removed] Sent: Thursday, August 15, 2002 1:59 PM
> To: [Email Address Removed] Subject: Index...
>
>
>
> I want to reindex all my indexes in all my tables
>
> How i can do that
>
> Thank
>
>
> _________________________________________________________________
> Affichez, modifiez et partagez gratuitement vos photos en ligne:
> http://photos.msn.com/support/worldwide.aspx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]
>
>
> Electronic mail is to be used for Bank business purposes only. Confidential
> information should not be sent via email as there is no expectation of
> privacy or integrity of the message through the internet.
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This email message has been scanned for the presence of
> computer viruses.
>
> Chevy Chase Bank
> **********************************************************************
>

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
MS Sql Server LazyDBA home page