I am doing a system in which, on occasion, I must perform 3 or more movements in the database: read a field, insert in another table, and update some tables; the situation here is that, sometimes, the insertion or update is not done due to some unexpected error, in those cases I require that all the operations carried out until the error, are undone. Is there a way to let C # or SQL know that you should undo them?
To give an example, when capturing the invoice of a supplier, the following operations are carried out:
What I want to know is if there is any way of, if there should be an error, for example in point 4, that I made a "rollback" all the previous points.
Thank you very much for your attention and your time.