title: T/F: Using IF statements in a procedure produces multiple plans
body: <p>In responses to <a href="https://stackoverflow.com/questions/1502741/is-it-good-practice-to-use-one-single-stored-procedure-that-accepts-a-variable-nu">this</a> question, KM said</p>
  
  <blockquote>
    <p>if you are on or above SQL Server 2005, you can use IFs to have multiple queries in the same procedure and each will have an query plan saved for it (equiv to a procedure for each on older versions), see the article in my answer or this link to proper section: sommarskog.se/dyn-search-2005.html#IF</p>
  </blockquote>
  
  <p>HLGEM added</p>
  
  <blockquote>
    <p>You can do that in earlier versions of SQL Server as well.</p>
  </blockquote>
  
  <p>I read that section of Sommarskog's excellent article but did not see anything about multiple plans.</p>
  
  <p>In later research, I read a quote <a href="http://social.msdn.microsoft.com/forums/en-US/sqlexpress/thread/73f0a6aa-b3e1-4e92-822b-3fb9c5ac482b/" rel="nofollow noreferrer">here</a> from Gert Drapers:</p>
  
  <blockquote>
    <p>Because SQL Server allows only one execution plan per stored procedure ...</p>
  </blockquote>
  
  <p>I don't know the date of that original article or the version of SQL Server he is referring to.</p>
  
  <p>Does anyone have a reliable reference that discusses this or, better yet, a test that proves that this is true?</p>