all groups > sql server (alternate) > september 2007 >
You're in the

sql server (alternate)

group:

indexes


indexes DaveP
9/13/2007 12:46:54 PM
sql server (alternate):
where can i find a example on how to
build a script to reindex all my tables
Tks
DaveP

Re: indexes DaveP
9/13/2007 3:06:56 PM
thank you much erland
[quoted text, click to view]

Re: indexes Erland Sommarskog
9/13/2007 9:51:53 PM
DaveP (dvs_bis@sbcglobal.net) writes:

[quoted text, click to view]

http://www.google.se/search?hl=sv&q=build+script+reindex+tables&btnG=S%C3%B6k&meta=

You could also look in Books Online for the definition of sysindexes and sysobjects if you are on SQL 2000 or sys.objects and sys.indexes if you
are on SQL 2005.

One thing to be careful with is that if fragmentation is below 30%, there is
not so much to gain with reindexing, so adding some intelligence to handle
this may be worth it. I don't have any example at hand, but the hits on
Google may give you something.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button