February 2, 2013 at 12:51 am
Dear,
I want to insert a row from Table1 to Table2 after that I want to delete that row from Table1.
But I wanna ensure that if the insert command is being executed successfully then delete command will execute. If the insert command is not being executed successfully then delete command will not execute too.
Please help me to solve the logic.
February 2, 2013 at 1:50 am
begin transaction
begin try
insert ...
delete ...
commit transaction
end try
begin catch
rollback transaction
end catch
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 2, 2013 at 4:44 am
Thank you, Gila Monster.
That works
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply