title: Is it possible to create a temporary table in a View and drop it after select?
body: <p>I need to alter one view and I want to introduce 2 temporary table before the SELECT.</p>
  
  <p>Is this possible? And how can I do it?</p>
  
  <pre><code>ALTER VIEW myView
  AS 
  
  SELECT *
  INTO #temporary1
  
  SELECT *
  INTO #temporary2
  
  SELECT * FROM #temporary1
  UNION ALL 
  SELECT * FROM #temporary1
  
  DROP TABLE #temporary1
  DROP TABLE #temporary2
  </code></pre>
  
  <p>When I attempt this it complains that ALTER VIEW must be the only statement in the batch.</p>
  
  <p>How can I achieve this?</p>