Re: i have two inserts and one delete i want in one transaction, is there any issue with this tsql strategy: http://rafb.net/paste/results/uY2KYP16.html



DECLRAE @Err INT
BEGIN TRAN

insert into...
SET @Err = @@ERROR
IF @Err <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN (@Err)
END

insert into...
SET @Err = @@ERROR
IF @Err <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN (@Err)
END
delete from ...
SET @Err = @@ERROR
IF @Err <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN (@Err)
END

COMMIT TRAN

"Daniel" <softwareengineer98037@xxxxxxxxx> wrote in message
news:eM3QcieCHHA.4016@xxxxxxxxxxxxxxxxxxxxxxx
i have two inserts and one delete i want in one transaction, is there any
issue with this tsql strategy: http://rafb.net/paste/results/uY2KYP16.html



.