Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RollBack transaction!

Status
Not open for further replies.

wendywam

Programmer
Jun 21, 2004
15
ZA
Hi
I have sql stored procedure like this
begin tran
sql statements....
if @error <> 0
begin
Rollback Tran
end
else
commit tran
What should happen is that if there is an error then the rollback will happen i.e no tables will be updated.
Now what happens if a rollback gets aborted?



 
anything not committed will rollback so theoretically the rollback is not needed but you will get an error if you don't include it and including it will get out of he transaction more quickly.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top