title: Insert into a temp table from a stored procedure on Sql Server 2000
body: <p>I'm trying to accomplish what is described here: </p>
  
  <p><a href="http://sqldev.wordpress.com/2008/05/06/insert-into-temporary-table-from-stored-procedure/" rel="nofollow noreferrer">http://sqldev.wordpress.com/2008/05/06/insert-into-temporary-table-from-stored-procedure/</a></p>
  
  <p>The article says (with support via comments) that this works on SQL sever 2000 but may not be as easy. </p>
  
  <blockquote>
    <p>This was a little tricky pre 2008 – as
    it turns out in SQL Server 2008 this
    can be done easily.</p>
  </blockquote>
  
  <p>and a comment states:</p>
  
  <blockquote>
    <p>It’s not a 2008 feature. it was there
    since i remember… from sql server
    2000? It’s a great feature anyway!</p>
  </blockquote>
  
  <p>How can I quickly accomplish this for SQL Server 2000? </p>
  
  <p>Using the code the article is based on, I'm getting the following error message:</p>
  
  <pre><code>Msg 197, Level 15, State 1, Line 7
  EXECUTE cannot be used as a source when inserting into a table variable.
  </code></pre>
  
  <p>I did find <a href="https://stackoverflow.com/questions/653714/how-to-select-into-temp-table-from-stored-procedure">this Stackoverflow post</a> and it also supports the concept that this can be done in SQL Server 2000 but this post was to address SQL Server 2005 and it doesn't go in to 2000 much.</p>