I have a simple select statement below:
SELECT Code = Cast([Code] as int)
FROM dbo.table
I get an error:
Conversion failed when converting the nvarchar value '?' to data type int.
I want to write IFERROR or CASE statement that would would replace error with a number such as -9999