MSDTC on server 'server is unavailable'

后端 未结 6 1894
我在风中等你
我在风中等你 2020-12-08 08:58

I get this weird error on SQL Server. And I cannot find solution in older posts.

I have this procedure:

create proc _upJM_SyncAll_test
as
begin
             


        
6条回答
  •  春和景丽
    2020-12-08 09:55

    Triggers are included in the implicit transaction required for insert, update, and delete statements. Because you are connecting to a linked server within a transaction, SQL Server promotes it to a Distributed Transaction.

    You'll need to configure MSDTC, you can either open MMC and load the MSDTC plugin or use the following script to open inbound and outbound transactions.

    https://technet.microsoft.com/en-us/library/cc731495.aspx

    REG QUERY "HKLM\Software\Microsoft\MSDTC\Security" /v NetworkDtcAccess
    REG QUERY "HKLM\Software\Microsoft\MSDTC\Security" /v NetworkDtcAccessTransactions
    REG QUERY "HKLM\Software\Microsoft\MSDTC\Security" /v NetworkDtcAccessInbound
    REG QUERY "HKLM\Software\Microsoft\MSDTC\Security" /v NetworkDtcAccessOutbound
    PAUSE
    
    REG ADD "HKLM\Software\Microsoft\MSDTC\Security" /f /v NetworkDtcAccess /t REG_DWORD /d 1
    REG ADD "HKLM\Software\Microsoft\MSDTC\Security" /f /v NetworkDtcAccessTransactions /t REG_DWORD /d 1
    REG ADD "HKLM\Software\Microsoft\MSDTC\Security" /f /v NetworkDtcAccessInbound /t REG_DWORD /d 1
    REG ADD "HKLM\Software\Microsoft\MSDTC\Security" /f /v NetworkDtcAccessOutbound /t REG_DWORD /d 1
    PAUSE
    
    net stop MSDTC
    net start MSDTC
    PAUSE
    

提交回复
热议问题