title: Reduce decimal data type precision & scale and avoid arithmetic overflow error
body: <p>I have a field in a SQL Server 2012 database that is currently decimal(30,20) because that is the format of the data provider. However, that large of a decimal is completely unnecessary and would like to trim it down to something like decimal(16,7) considering this table has millions of rows.</p>
  
  <p>I tried the following SQL:</p>
  
  <pre><code>alter table mytable alter column mycolumn decimal(16,7)
  </code></pre>
  
  <p>But that resulted in the error:</p>
  
  <pre><code>Arithmetic overflow error converting numeric to data type numeric.
  </code></pre>
  
  <p>What is the best way to change this field? I obviously realize the error is occurring because the values in the column exceed the new precision. What I'm wondering is if there is a script that can cut off any digits past the 7th decimal point and then convert the column data type?</p>