If the insert into table person is successful, but the insert into table subject fails, delete the person record and all records associated with the person that were also inserted.
If the insert into table person is successful, and the insert into subject is successful, but the insert into the booking table fails, delete the subject record, the person record ,and all records associated with the person that were also inserted.
The reason for the failure into the 3 tables (person, subject, booking) should be logged to tblErrors . Also, a message should be written to tblErrors which logs the fact that this situation has occurred.
I have few stored procs which does inserts and updates
How would i capture the record which is not getting inserted and log in to log table and delete the previous records which got inserted which are related to that.
View Complete Post