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)
 Force compiling

Author  Topic 

timoqvist
Starting Member

8 Posts

Posted - 2006-09-21 : 04:39:25
Hi, just wondering if there is any way to force compilation of an arbitrary SP without actually running the SP.

/TQ

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-09-21 : 04:46:01
Use sp_recompile 'proc_name'

or create procedure with RECOMPILE option.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

timoqvist
Starting Member

8 Posts

Posted - 2006-09-21 : 05:26:26
sp_recompile only tells the server to recompile the next time the SP is executed, that's not what I want, I want it to recompile a bunch of procedures in one go *without* running them.

/tq
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-09-21 : 07:30:55
you have to run the sproc to have it recompile.




Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-21 : 11:23:12
"sp_recompile only tells the server to recompile the next time the SP is executed, that's not what I want, I want it to recompile a bunch of procedures in one go *without* running them"

Sounds like, more or less!, the same thing to me - what are you wanting to achieve? (Might be something different we can suggest)

Kristen
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-09-21 : 15:12:02
Not much point in compiling a procedure if it never gets executed. Best option is sp_recompile as was already mentioned.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-22 : 02:22:59
Well, guessing at the underlying question, I have an opinion that it would be quick good to get the query recompiled AND cached in Quiet Time ...

Kristen
Go to Top of Page
   

- Advertisement -