title: What factors can cause Stored Procedure Recompilation on SQL Server?
body: <p>What factors should I be aware of that can cause excessive stored procedure recompilation?</p>
  
  <p>Examples of the code that will cause a stored procedure to recompile would be useful. The purpose would be to avoid a recompile if possible which should improve performance. </p>
  
  <p>Dynamic SQL and variable paths resulting in different outputs (either by data type and/or number of columns) seem like they could present a problem. Are the assumptions correct? Are there other examples.</p>
  
  <p>Edit: I did find another example. Creating a temporary table in a flow control statement will cause a recompile. </p>