If the the source column is a varchar with a comma in the text you have to remove the comma before converting it to an int datatype.
SELECT CAST(REPLACE('100,000',','
You can convert it directly to money datatype:
SELECT CAST('100,000' AS money)
Or to money and then to int
SELECT CAST(CAST('100,000' AS money) AS int)
Main Topics
Browse All Topics





by: kathikPosted on 2007-04-03 at 14:54:01ID: 18847149
I would do this: cast(replace([price],',''' ) as int)
Remove the commas with replace, then use cast to cast the value to an integer.