This code begins a database transaction, runs some code, and then either commits the transaction if there are no errors or rolls it back if errors occur. It also sets the transaction isolation level to read committed at the end.
This code begins a database transaction, runs some code, and then either commits the transaction if there are no errors or rolls it back if errors occur. It also sets the transaction isolation level to read committed at the end.
This code begins a database transaction, runs some code, and then either commits the transaction if there are no errors or rolls it back if errors occur. It also sets the transaction isolation level to read committed at the end.
IF @@ERROR = 0 BEGIN COMMIT TRANSACTION SET TRANSACTION ISOLATION LEVEL READ COMMITTED END ELSE BEGIN ROLLBACK TRANSACTION SET TRANSACTION ISOLATION LEVEL READ COMMITTED END END