I have a table Table1 with records
Table1
-------------------------------
ID F1
-------------------------------
01 1
02 OK
03 52
04 53
05 Null
------------------------------
here I want to change data type of F1 Varchar to Decimal(3,0); then i create a new table with new structure.
I want to insert each recod of old table in new, by explicitly converting varchar to decimal. so i am writing this command in try catch block. where if error generates, then in catch block i can fill it with its default value. but this whole working is performed between begin transaction and commit transaction block. So when error caught in catch block, then no furthure working can be performed, error occurs
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
How to prevent this transaction to be rolled back even when error occures in try catch block.