title: SQL INSERT using tables where the columns have different data types and getting error converting
body: <p>I have two tables and I would like to insert from one into the other. In my staging (source) table every column is defined as <code>nvarchar(300)</code> and this restriction cannot change.</p>
  
  <p>In my destination table, the columns are of all different types. If I want to, for example, select from the source table (data type <code>nvarchar(300)</code>) and insert that column into a data type of <code>decimal(28, 16)</code>.</p>
  
  <p>When this happens I get the following error:</p>
  
  <blockquote>
    <p><em>Error converting data type nvarchar to numeric.</em></p>
  </blockquote>
  
  <p>Even when I use a cast I get the error.</p>
  
  <pre><code>INSERT INTO Destination (
      Weighting
  )
  VALUES (
      CAST(src.Weighting AS decimal(28, 16))
  )
  </code></pre>
  
  <p>Could <code>null</code> values be affecting this at all? Is there anything else to consider?</p>