how to use "Save Transaction" in distributed Transactions

  • Dear All

    I getting the following error while I am using SAVE TRANSACTION command in Distributed transaction.

    I have 2 servers and both the servers are linked to each other.MSDTC service is also running on both of them.

    I have started the Transaction with

    BEGIN DISTRIBUTED TRANSACTION command still i am getting error . Please help.

    the error is

    Server: Msg 627, Level 16, State 1, Line 2

    Cannot use SAVE TRANSACTION within a distributed transaction.

     

    The code which i am executing is

    BEGIN DISTRIBUTED TRANSACTION

    SAVE TRAN ABC

    SELECT * FROM LINKEDSERVER.ORERMS_V2.DBO.TRANSACTIONLOG

    COMMIT TRAN

  • Just as the error message says, you cannot use Save Transaction with distributed transactions.  From BOL:

    SAVE TRANSACTION is not supported in distributed transactions started either explicitly with BEGIN DISTRIBUTED TRANSACTION or escalated from a local transaction.

    Hope this helps.



    Mark

  • I have started transaction with

    BEGIN DISTRIBUTED TRANSACTON statement but still getting the same error.

     

    ??

  • You cannot use SAVE TRANSACTION with a distributed transaction.

    I will take a few guesses here at what you are trying to do. 

    If you are not intending to do a distributed transaction, just do BEGIN TRANSACTION.

    If you are intending to complete and write out a distributed the transaction, do COMMIT TRANSACTION.

    If this does not help, it may be best for you to check your Books Online and read up on how transactions operate.



    Mark

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

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