dbTalk Databases Forums  

indexes

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss indexes in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DaveP
 
Posts: n/a

Default indexes - 09-13-2007 , 02:46 PM






where can i find a example on how to
build a script to reindex all my tables
Tks
DaveP



Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: indexes - 09-13-2007 , 04:51 PM






DaveP (dvs_bis (AT) sbcglobal (DOT) net) writes:

Quote:
where can i find a example on how to
build a script to reindex all my tables
http://www.google.se/search?hl=sv&q=... 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 (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
DaveP
 
Posts: n/a

Default Re: indexes - 09-13-2007 , 05:06 PM



thank you much erland
"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> wrote

Quote:
DaveP (dvs_bis (AT) sbcglobal (DOT) net) writes:

where can i find a example on how to
build a script to reindex all my tables

http://www.google.se/search?hl=sv&q=... 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 (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.