Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 recompiling tables

Author  Topic 

chetan06
Starting Member

11 Posts

Posted - 2007-05-23 : 05:34:24
Hi friends..

I have run Update statistics on one database (size approx 90GB).
Now i have task of recompile all tables in the datatbase...

can anybody help me on this..

Cjain

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-23 : 05:40:33
define "recompiling tables".

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

chetan06
Starting Member

11 Posts

Posted - 2007-05-23 : 05:49:25
can u please give me full syntex.........

Cjain
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-23 : 05:51:31
full syntax for what???

what do you mean by recompiling tabels?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

chetan06
Starting Member

11 Posts

Posted - 2007-05-23 : 06:10:05
meaning recompiling all tables in db ..

like --- EXEC sp_recompile titles ( This example causes the triggers and stored procedures that uses the titles table to be recompiled the next time they are run.)

like wise i want to re-comile all tables in db




Cjain
Go to Top of Page

deepakontheweb
Starting Member

14 Posts

Posted - 2007-05-23 : 06:14:43
sp_updatestats
Runs UPDATE STATISTICS against all user-defined tables in the current database.


This example updates the statistics for tables in the pubs database.

USE pubs
EXEC sp_updatestats



Check the sql books online for more details.


Deepak Kumar
SQL Server MVP, MCDBA

deepak.kumar@sqlknowledge.com
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-05-23 : 07:08:57
I think what the OP is asking is how to recompile Sprocs and Triggers that are based on a table which has had its statistics updated.

I reckon that sysdepends is "shot" on SQL2000 such that this cannot be done using sysdepends.

(We monitor average execution time of Sprocs and recompile them when their average execution time falls off. Another way is to reboot your SQL Server periodically )

Brett was asking something similar recently:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83814

Kristen
Go to Top of Page
   

- Advertisement -