Proper placement of SET XACT_ABORT ON?

  • One of my developers has used the T-SQL command SET XACT_ABORT ON (which I confess I was unfamiliar with) in his stored procedures. I have reason to believe that the transaction is failing, for one reason or another, to store the data. In looking at his code he had a statement like this:

    BEGIN TRANSACTION

    SET XACT_ABORT ON

    However, in looking at the online help, they had the sequence of statements like this:

    SET XACT_ABORT ON

    BEGIN TRANSACTION

    My question is, does it matter?


    Doctor Who

  • This was removed by the editor as SPAM

  • We have found that, if you are not using distributed transactions, there is no need to use SET XACT_ABORT ON when you are using the BEGIN TRANSACTION. Makes it a lot easier.

    However, if you are going to use both - it is best to put SET XACT_ABORT ON first.

    Guarddata-

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply