Do all stored procs in a database get recompiled once sp_updatestats is run
against a database ? Using SQL 2000According to the BOL, the procs should be recompiled (i.e. new plans should
be generated). See the following excerpt from the BOL:
Recompiling Execution Plans
... The conditions that cause a plan to be invalidated include:
a.. New distribution statistics generated either explicitly from a
statement such as UPDATE STATISTICS or automatically.
...
However, my test didn't seem to confirm this to be always the case. When I
ran UPDATE STATISTICS on pubs..authors, I did see the following simple proc
got recompiled:
create proc pr_authors
as
select au_id from authors where au_id = '172-32-1176'
More specifically, I didn't see SP:Recompile event class in SQL Trace, which
you would see if you do a sp_recompile authors.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:u8Kvj9vgDHA.3144@.tk2msftngp13.phx.gbl...
> Do all stored procs in a database get recompiled once sp_updatestats is
run
> against a database ? Using SQL 2000
>|||If the structure of the table(s) that a stored procedure uses is
changed, or when the statistics of the table(s) is changed, then the
stored procedure is marked for compilation. The next time the stored
procedure is used it will be (re)compiled.
Gert-Jan
Hassan wrote:
> Do all stored procs in a database get recompiled once sp_updatestats is run
> against a database ? Using SQL 2000
No comments:
Post a Comment