dbTalk Databases Forums  

Error Handling.

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss Error Handling. in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Sean McCown
 
Posts: n/a

Default RE: Error Handling. - 05-23-2008 , 09:54 AM






The fact that both of these statements are inside the transaction
automatically means that they'll both pass or fail together. You don't need
to do anything else to make it happen.
--
Read my book reviews at:
www.ITBookworm.com

Blog Author of:
Database Underground -- http://weblog.infoworld.com/dbunderground/
DBA Rant – http://dbarant.blogspot.com




"Noor" wrote:

Quote:
Just want to clarify one thing before i have to BEGIN DISTRIBUTED
TRANSACTION on production boxes. here is an example.

SET xact_abort ON
BEGIN DISTRIBUTED TRANSACTION

UPDATE Table on LocalServer

UPDATE Table on RemoteServer

COMMIT

Should I implement the error handling right after each updates? to make sure
both the transaction successfully works then COMMIT everything else ROLLBACK
every thing.

I can give you one example, I want to Withdraw the money from one account
which is on Database1 and I want to deposit the amount which is Datbase2. I
want to make sure if deposit the transaction succcessfully completed then it
will commit the transaction.

Please advice, how I can do with BEGIN DISTRIBUTED TRANSACTION

Thanks







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.