title: CAST and IsNumeric
body: <p>Why would the following query return "Error converting data type varchar to bigint"?  Doesn't IsNumeric make the CAST safe?  I've tried every numeric datatype in the cast and get the same "Error converting..." error.  I don't believe the size of the resulting number is a problem because overflow is a different error.</p>
  
  <p>The interesting thing is, in management studio, the results actually show up in the results pane for a split second before the error comes back.</p>
  
  <pre><code>SELECT CAST(myVarcharColumn AS bigint)  
  FROM myTable  
  WHERE IsNumeric(myVarcharColumn) = 1 AND myVarcharColumn IS NOT NULL  
  GROUP BY myVarcharColumn
  </code></pre>
  
  <p>Any thoughts?</p>