Need Help with Conversion
I am doing a data migration from source SQL DB to target SQL DB. The data type in a particular source column is text and the target column is data type int in the product table. The problem is the user entered in product numbers with letters in the source table. I need to insert the rows with that product number to the new table that has a data type of int. SQL doesn't like it. I tried cast the value to int and get an error. Is it possible to cast a text data type value like 333C to int?
CAST(CAST(p.ProductID AS VARCHAR(20)) AS INT)