Hi, I met a problem, please help.
for Loop begin tran select record insert record commit tran if exception, rollback tran end
In 1st occurrence, I insert a record with invalid FK value, then throw exception when commit tran. In 2nd occurrence, either I select record or insert correct record, it throw exception, the exception is regarding the 1st occurrence.
As each occurrence in the for loop have no dependency, therefore, I want to commit for those correct record, and just rollback for those invalid record. However, seems I cannot do that, please help.
|