sql try/catch rollback/commit – preventing erroneous commit after rollback
I always thought this was one of the better articles on the subject. It includes the following example that I think makes it clear and includes the frequently overlooked @@trancount which is needed for reliable nested transactions PRINT ‘BEFORE TRY’ BEGIN TRY BEGIN TRAN PRINT ‘First Statement in the TRY block’ INSERT INTO dbo.Account(AccountId, Name … Read more