title: t sql select into existing table new column
body: <p>Hi I have a temp table (#temptable1) and I want to add a column from another temp table (#temptable2) into that, my query is as follows:</p>
  
  <pre><code>select 
  Customer
  ,CustName
  ,KeyAccountGroups
  ,sum(Weeksales) as Weeksales
  into #temptable1
  group by Customer
  ,CustName
  ,KeyAccountGroups
  
  
  select
  SUM(QtyInvoiced) as MonthTot
  ,Customer
  into #temptalbe2
  from SalesSum
  where InvoiceDate between @dtMonthStart and @dtMonthEnd
  group by Customer
  
  
  INSERT INTO #temptable1
  SELECT MonthTot FROM #temptable2
  where #temptable1.Customer = #temptable2.Customer
  </code></pre>
  
  <p>I get the following:  Column name or number of supplied values does not match table definition.</p>