I have a column in table of type varchar(255). I need to insert data from this table into another table and the column type at the destination is int. I used the following SQL but it says ColumnName
Conversion failed when converting the varchar value '212' to data type int.
SELECT CASE WHEN ColumnName in ('na', ') THEN '0' ELSE CAST(ColumnName AS INT) END
I have the value 212 in my column why is it having trouble converting it? Please advise, thanks in advance.
View Complete Post