I have a stored procedure that basically calls 7 or 8 other stored procedures. I'd like know if recompiling the outer stored procedure will cause the 7 or 8 to also be recompiled?
views:
24answers:
2sql server 2005 - hence the tag
Phil
2010-03-18 10:31:39
+2
A:
No.
Optimizing SQL Server Stored Procedures to Avoid Recompiles
Stored procedures will normally recompile before execution for a number of reasons, including: dropping and recreating the stored procedure, using the WITH RECOMPILE clause in the CREATE PROCEDURE or the EXECUTE statement, changing the schema of any referenced objects, running the sp_recompile system stored procedure against a table referenced by the stored procedure, restoring the database containing the stored procedure or any object referenced by the stored procedure, or the stored procedures plan dropping from the cache.
About the only automatic way a stored procedure will be recompiled is by adding the WITH RECOMPILE
KM
2010-03-18 11:37:13