title: How to Change datatype of a Column in a temporary table in SQL
body: <p>Is there any way to change(increase) the data type of a column while saving the values into a temporary table?</p>
  
  <pre><code>SELECT TableA.ID_NO, sum(TABLEA.COST * TABLEB.QTY) as TOTAL
  INTO #matCalc
  FROM TABLEA A 
  INNER JOIN TABLEB 
  ON A.ID_NO = B.ID_NO
  </code></pre>
  
  <p>We have a bigger calculation in the actual query. When we execute our stored proc we get an error "arithmetic overflow error converting numeric to data type numeric".</p>
  
  <p>Any solution is greatly appreciated.</p>
  
  <p>Thank you.</p>