Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2012
    Posts
    3

    Unanswered: Linked server: "Cannot start more transactions on this session."

    Hi All,

    I have a job on a production server A which has two steps:

    Step1: Inserts records older than one year from a databse on server B into a database on server A
    Step 2: Deletes those records from server B if step 1 was successful

    Problem is that step 1 is executing successfully however step 2 is 'showing' successful but is not deleting records from server B, job history has following message logged:

    OLE DB provider "SQLNCLI" for linked server "ServerB" returned message "Cannot start more transactions on this session.". [SQLSTATE 01000] (Message 7412). The step succeeded.

    I checked and found that if I try to delete records manually from server A then deletion is successful.

    Please suggest

    Need help urgently!!
    Thanks in advance.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    mmmmm.... Service Broker? Or fewer larger set based transactions? Are you deleting by referencing the 4 part server name? Have you tried passing the delete command to the sp_executesql command in the remote database as a sql string or as a remote procedure call? It is really hard to say with the amount of detail you have provided.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Mar 2012
    Posts
    3
    Thanks for having a look!

    Below is the query used inside the job code:

    BEGIN TRANSACTION
    DELETE from [ServerB].[DatabaseName].[dbo].Tablename where accesstime < Getdate() - 365
    COMMIT TRANSACTION

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    what happens without the explicit transaction? A single DML sql statement is executed as an implicit transaction. No need for the BEGIN TRANNIE and END TRANNIE.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Is MSDTC running on production server A?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #6
    Join Date
    Mar 2012
    Posts
    3
    @Pat: MSDTC is running on both

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •