INF: Conditions When Stored Procedures Are Recompiled by SQL (62860)



The information in this article applies to:

  • Microsoft SQL Server 4.2x
  • Microsoft SQL Server 6.0
  • Microsoft SQL Server 6.5

This article was previously published under Q62860

SUMMARY

The following list contains the various conditions under which SQL Server will recompile a stored procedure:
  • An index is dropped on the referenced table.
  • The table is dropped and re-created.
  • A rule or default is added to the table.
  • The procedure is dropped and re-created.
  • All copies of the execution plan in the cache are currently in use.
  • The procedure executed was created using the WITH RECOMPILE option.
  • The procedure was executed with the WITH RECOMPILE option.
  • The requested procedure is no longer in the cache.

MORE INFORMATION

SQLServer 7.0 comes with several new reasons for causing a stored procedure to recompile. For additional information on stored procedure recompilation with SQLServer 7.0, click the article number below to view the article in the Microsoft Knowledge Base:

243586 INF: Troubleshooting Stored Procedure Recompilation


Modification Type:MajorLast Reviewed:11/14/2003
Keywords:kbinfo kbProgramming KB62860