Implement SQL transactions on complicated procedures like Merge Patients
Merge patients is still touchy in 8.0.7; a failed merge can leave the database in an inconsistent state.
Issuing a simple BEGIN statement prior to any updates/deletes/inserts associated with the merge process, then a commit if the statements complete successfully ( or a rollback in the event of an error ) would prevent the resulting inconsistencies from a failed merge process.