How to make trasanction cover multiple stored procedures?

I need to include several stored procedures in one transaction in the same database, if any of the stored procedures failed, the transaction is rolled back to the entire stored procedure processed in the area.

I am working with SQL-SERVER 2008

+3
source share
4 answers
begin transaction
begin try
  exec proc_1
  exec proc_2
  exec proc_3
  commit transaction
end try
begin catch
  rollback transaction
end catch
+4
source

, , . - , . , (MS SQL Server, MySQL ..), .

+2
+1
+1

Source: https://habr.com/ru/post/1720805/


All Articles