title: Switch execution plan on/off in stored procedure of SQL Server
body: <p>In my stored procedure, it will do a lot of insert/update queries, and call a few nested stored procedures.</p>
  
  <p>I want to disable the execution plan, bypassing the above mentioned queries, then switch it on to start profiling those queries I am interested in.</p>
  
  <p>for example:</p>
  
  <p>...switch off execution plan</p>
  
  <pre><code>INSERT INTO FOO ...
  UPDATE FOO...
  EXEC usp_FOO
  </code></pre>
  
  <p>...switch on execution plan here then I can start getting the performance stat</p>
  
  <pre><code>SELECT * FROM FOO
  </code></pre>
  
  <p>In SQL Server Management Studio, we have "Include Actual Execution Plan" for performance trace/debug, but if there are more than 100 queries, the execution plan output will exceed and stop working. So I believe there should be some switch like 'SET EXECUTION PLAN OFF' something like that</p>