title: Finding the data types of a SQL temporary table
body: <p>I need to switch from using a #temp table to a @table variable so that I can use it in a function. </p>
  
  <p>My query uses insert into #temp (from multiple tables) like so:</p>
  
  <pre><code>SELECT 
    a.col1, 
    a.col2, 
    b.col1... 
  INTO #temp
  FROM ...
  </code></pre>
  
  <p>Is there an easy way to find out the data types of the columns in the #temp table so that I can create the @table variable with the same columns and data types as #temp?</p>