views:

8316

answers:

1

i want to convert a string field to integer using sql query?

+8  A: 

You could use CAST or CONVERT:

SELECT CAST(MyVarcharCol AS INT) FROM Table

SELECT CONVERT(INT, MyVarcharCol) FROM Table
CMS