title: SQL Server cast fails with arithmetic overflow
body: <p>According to the entry for decimal and numeric data types in SQL Server 2008 Books Online, precision is:</p>
  
  <blockquote>
    <p>p (precision) 
    The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18.</p>
  </blockquote>
  
  <p>However, the second select below fails with "Arithmetic overflow error converting int to data type numeric."</p>
  
  <pre><code>SELECT CAST(123456789 as decimal(9,0))
  SELECT CAST(123456789 as decimal(9,1))
  </code></pre>