Home T-SQL Transaction syntax
 I'm implementing a mission critical stored procedure that will perform UPDATE, DELETE and INSERT and I want to make sure my TRANSACTION is correctly formed. I've seen some TRANSACTION statements where there's a check after each step. I've also seen this kind where the entire set of steps are simply placed within a singleTRANSACTION block without any "check points" along the way. Is this a well formed TRANSACTION that will roll back everything i.e. UPDATE, DELETE and INSERT, if there's any error at any point. Here's the TRANSACTION: BEGIN TRANSACTION BEGIN TRY UPDATE SomeTable SET SomeColumnValue = 123 WHERE Id = 123456 DELETE FROM SomeOtherTable WHERE Id = 789 INSERT INTO ThirdTable (Column1, Column2) VALUE ('Hello World', 1234567) END TRY BEGIN CATCH ROLLBACK TRANSACTION END CATCH