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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Method to defer transactions

Status
Not open for further replies.

bearit

Programmer
Sep 26, 2002
4
US
Hi All,
I'm looking for the cleanest way to postpone commiting a transaction until an update in a related table is complete. I believe Oracle has a deferred option associated with it's table properties but am thinking it's not as easy as that with a SQL Server tbl. There's probably going to be more code required. Any ideas or suggestions on where to start?
Thanks--
 
begin tran
update tbl1
if @@error <> 0
begin
rollback tran
return
end
update tbl2
if @@error <> 0
begin
rollback tran
return
end
commit tran

======================================
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