title: tSQL - Conversion from varchar to numeric works for all but integer
body: <p>I have a table with numbers in a <code>varchar(255)</code> field. They're all greater than one and have multiple decimal places. I'd like to convert them to integers. According to every web site I've consulted, including <a href="https://stackoverflow.com/questions/728833/convert-a-string-to-int-using-sql-query"> this one on StackOverflow</a>, either of these should work:</p>
  <pre><code>SELECT CAST(VarcharCol AS INT) FROM MyTable
  
  SELECT CONVERT(INT, VarcharCol) FROM MyTable
  </code></pre>
  <p>These both work for me for every kind of numeric value but <code>integer</code> - I can convert to <code>float</code>, <code>decimal</code>, etc. just fine, but trying to convert to <code>integer</code> gives me the following error:</p>
  <blockquote>
  <p>Conversion failed when converting the varchar value '7082.7758172'
  to data type int.</p>
  </blockquote>
  <p>I've worked around the problem by converting to data type <code>Decimal(6,0)</code>, which works fine. But just for my education, can anyone tell me why converting to data type <code>int</code> (or <code>integer</code>) gives me an error? Thanks.</p>