You could use CAST or CONVERT:
SELECT CAST(MyVarcharCol AS INT) FROM Table
SELECT CONVERT(INT, MyVarcharCol) FROM Table
Answer from Christian C. Salvadó on Stack OverflowUse the convert function.
SELECT CONVERT(varchar(10), field_name) FROM table_name
Use the STR function:
SELECT STR(field_name) FROM table_name
Arguments
float_expression
Is an expression of approximate numeric (float) data type with a decimal point.
length
Is the total length. This includes decimal point, sign, digits, and spaces. The default is 10.
decimal
Is the number of places to the right of the decimal point. decimal must be less than or equal to 16. If decimal is more than 16 then the result is truncated to sixteen places to the right of the decimal point.
source: https://msdn.microsoft.com/en-us/library/ms189527.aspx
How do I convert these values (currently String) into INT (but with a catch)
How to convert or cast int to string in SQL Server - Stack Overflow
Error on converting String to Integer
sql server - convert string to integer and round - Database Administrators Stack Exchange
Videos
Imagine I have this table list of values.
How do I convert all of these into INT?
And for those that have > in them, to automatically convert them into '600'.
So if it is >700, still '600'
(in my environment, everytime there is a >, it is 100% over 600, so I am okay setting it to '600'.
Thanks
You should convert. CONVERT(VARCHAR(4), your_col)
If you are looking for converting values in the column for your purpose to use in application, you can use this following-
SELECT CAST(your_column AS VARCHAR(100))
--VARCHAR length based on your data
But if you are looking for change data type of your database column directly, you can try this-
ALTER TABLE TableName
ALTER COLUMN your_column VARCHAR(200) NULL
--NULL or NOT NULL based on the data already stored in database