Home > Archive > MS SQL Server security > November 2006 > Re: i have two inserts and one delete i want in one transaction, is there any issue with this tsql









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: i have two inserts and one delete i want in one transaction, is there any issue with this tsql
Uri Dimant

2006-11-19, 5:12 am

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" < softwareengineer9803
7@yahoo.com> wrote in message
news:eM3QcieCHHA.4016@TK2MSFTNGP02.phx.gbl...
>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
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com