title: How to Auto Generate Code for Stored Procedure Column Data Types - SQL Server
body: <p>My desired end result is to simply be able to SELECT from a Stored Procedure.  I've searched the Internet and unfortunately the Internet said this can't be done and that you <strong>first need to create a Temp Table</strong> to store the data.  My problem is that you must first define the columns in the Temp Table before Executing the STORED Procedure.  This is just time consuming.  I simply want to take the data from the stored procedure and just stick it into a Temp Table.  </p>
  
  <p>What is the <strong>FASTEST</strong> route to achieve this from a coding perspective?  To put it simply it's time consuming to first have to lookup the returned fields from a Stored Procedure and then write them all out.  </p>
  
  <blockquote>
    <p>Is there some sort of tool that can just build the CREATE Table Statement based on the Stored Procedure?  See screenshot for clarification.  </p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/NZ8S6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NZ8S6.png" alt="enter image description here"></a></p>
  
  <p>Most of the Stored Procedures I'm dealing with have 50+ fields.  I don't look forward to defining each of these fields manually.</p>
  
  <p>Here is good <a href="https://stackoverflow.com/questions/653714/insert-results-of-a-stored-procedure-into-a-temporary-table">SO Post</a> that got me this far but not what I was hoping.  This still takes too much time.  What are experienced SQL Server guys doing?  I've only just recently made the jump from Oracle to SQL Server and I see that Temp Tables are a big deal in SQL Server from what I can tell.</p>