I'm trying to load 97m rows by converting a data type of a column which is supposed to be a numeric (BIGINT) field but currently stored as varchar(11). During the load process, due to 1 or 2 bad data rows, the whole process fails. I've been trying to extract the bad records(s) using ON ERROR destination, but something's not working.
Source table:
ID bigint,
PurchaseAmount varchar(11)
Destination table:
ID bigint,
PurchaseAmount bigint
ONERROR table
ID bigint,
PurchaseAmount varchar(11)
Select query
Select ID, Cast(PurchaseAmount as bigint) as PurchaseAmount from SourceTable
Is there any other way I can fix the issue. I've tried using ON Error on both source and destination. But doesn't seem to work.
Any help will be appreciated!!!