This is how to convert a string to number to an SQL Server sentence.

SELECT CAST(YourVarcharCol AS INT) FROM Table

examples

Convert to Integer
Select Cast(Customers.CodeId as Int) from Customers

Convert to a real
Select Cast(Customers.CodeId as float) from Customers

Leave a Reply

Your email address will not be published. Required fields are marked *