title: Create an SQL temp table using EXEC
body: <p>I need to create a temp table dynamically since I don't know in advance all the columns I will use.</p>
  <p>So let's say I need to create a table with fixed columns</p>
  <pre><code>Item int, start int, end int 
  </code></pre>
  <p>and</p>
  <p>variable columns <code>(Rcpt1 int, Rcpt2 int)</code> that I managed to put in an nvarchar variable <code>@columnsRcpt</code> + 2 more variable columns <code>@Start</code> and <code>@End</code>.
  So I try to build my query as such :</p>
  <pre><code>@qry = 'CREATE TABLE #InvRcpt (SKU nvarchar(25), '
          + @Start + ' int' 
          + @columnsRcpt +', 
            Vendu int, 
            [Retrait d''inventaire] int, 
            Ajout int, 
            Solde int, ' 
            + @End + ' int)'
  Exec(@qry)
  select * from #InvRcpt
  </code></pre>
  <p>But it doesn't work, I'm sure that I miss something syntax wise.</p>