Is it necessary to execute "SET XACT_ABORT ON" before "BEGIN TRANSACTION"?
I have tried to call "SET XACT_ABORT ON" after "BEGIN TRANSACTION" and it works fine over a distributed transaction which includes a linked server.
XACT_ABORT is used to control the flow the current transaction.
If it is ON the Entire Transaction will be rollbacked and the Transaction Batch will be terminated immediately.
If it is OFF when the runtime error the current statement only rollbacked and the transaction batch will be executed with out any termination.
It is up to you what kind of behavior you need on your transaction.
But as per the Books online they are not recommending to use this option on Distributed Transactions.
See more on Books Online Under SET XACT_ABORT.
No comments:
Post a Comment