title: Execution plan over query with temp tables
body: <p>I've a stored procedure that does something like this:</p>
  
  <pre><code>SELECT Id
  INTO #temp
  FROM table
  WHERE ...
  
  DELETE FROM #temp
  INNER JOIN table2 ON a=b
  WHERE ...
  </code></pre>
  
  <p>But it's running slowly. When I try to view the Execution Plan I can't since the SQL Server Management Studio says "Msg 208, Level 16, State 0, Line 31 Invalid object name '#temp'."</p>
  
  <p>Is there any way to view the execution plan (or the execution details (not the plan)) for such script?</p>