MSDTC on server 'server is unavailable'

后端 未结 6 1895
我在风中等你
我在风中等你 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:43

    In my case, the service was stopped. solution: need to turn the MSDTC service on

    1. go to Services. (START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES)
    2. Find the service called 'Distributed Transaction Coordinator' and RIGHT CLICK (on it and select) > Start.
    3. make this service to run Automatically for solving this issue permanently
    0 讨论(0)
  • 2020-12-08 09:48

    I ran into the same error, however it wasn't as simple as the Distributed Transaction Coordinator service from not running. I received a driver update automatically through windows that was causing issues with COM+ and not allowing MSDTC to communicate properly even though the MSDTC service was running. In my case, it was an issue with HP hotkey drivers but in researching I found other reports of issues with audio drivers from other manufacturers causing this as well.

    To check to see if you have a similar issue, launch Component Services (dcomcnfg.exe), then expand Component Services > Computers > My Computer, from here click on 'COM+ Applications' to see if an error will pop-up with "COM+ unable to talk to Microsoft Distributed Transaction Coordinator" or there will be a red error over the icon for My Computer in the navigation.

    The fix for me was to disable the 'HP Hotkey Service" and "HotKeyServiceUWP" services. Once those were disable, MSDTC immediately started working.

    0 讨论(0)
  • 2020-12-08 09:48

    In my case I had a named instance of Microsoft SQL Server at a remote server and the error output of my application looked like this:

    System.Data.SqlClient.SqlException (0x80131904): MSDTC on server 'SERVER\INST_NAME' is unavailable.
    

    Experimenting with the SQL connection string, such as replacing the SERVER\INST_NAME with SERVER,TCP_PORT_NUMBER did not help. I was still getting the same error and I decided to install a default instance (MSSQLSERVER) so that the SQL Server name became SERVER only. This solved the problem as the RPC and MSDTC started resolving the name.

    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2020-12-08 09:59

    My issue was resolved by disabling a conflicting service/driver. I disabled all of my HP services (HP App Helper, HP CASL, HP System Info), and now it works fine.

    0 讨论(0)
  • 2020-12-08 10:02

    'Distributed Transaction Coordinator' service was not running, So started service and changed service type to automatic too.

    0 讨论(0)
提交回复
热议问题