locked
The procedure 'sp_replicationdboption' cannot be executed within a transaction RRS feed

  • Question

  • Hi

    I trying to do a merge replication of my DB.

    When I execute this command:

    use [xxx]
    
    
    exec sp_replicationdboption @dbname = N'xxx', @optname = N'merge publish', @value = N'true'
    GO


    I'v got this messages:

    Msg 15002, Level 16, State 1, Procedure sp_replicationdboption, Line 94
    The procedure 'sp_replicationdboption' cannot be executed within a transaction.

    What is a solution? I looking in this forum and google and still haven't the answer. Can anybody help me?

    Monday, November 19, 2018 3:49 PM

All replies

  • Hello,

    Execute the below and try again,

    sp_removedbreplication 'DatabaseName'

    Regards;
    Vivek Janakiraman
    www.jbswiki.com


    Tuesday, November 20, 2018 12:44 AM
  • Hi Kupiecu,

     

    The error message indicated that there is an active transaction in this session. Could you please check the open transaction in this session via the command: DBCC OPENTRAN.

     

    Then, please commit these active transactions via the following command:

     

    declare @TRANCOUNT int
    select @TRANCOUNT=@@TRANCOUNT
     
    while @TRANCOUNT>0
    begin
    commit tran 
    print 'committing tran'
    select @TRANCOUNT=@@TRANCOUNT
    end

     

    After committing these active transactions, please do the operation in your post again.

     

    Best Regards,

    Emily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, November 20, 2018 6:09 AM