Linked servers SQLNCLI problem. “No transaction is active”

前端 未结 4 540
甜味超标
甜味超标 2021-01-06 07:39

Im trying to execute a stored procedure and simply insert its results in a temporary table, and I\'m getting the following message:

The operation coul

相关标签:
4条回答
  • 2021-01-06 08:03

    You also have to check the DNS name resolution in the IP network configuration.

    For example, you have a server called server-a.mydomain.com and another one called server-b.otherdomain.com, log in the server-a and do a "ping server-b" (without the domain).

    If it responds "Ping request could not find host server-b. Please check the name and try again." that is the problem.

    Go to the Control Pannel > Network Connections > Right click in the network card > properties > Internet Protocol > Properties > Advanced > DNS > Append this DNS suffix in order. And here add the local domain: mydomain.com and then add the remote domain: otherdomain.com Click OK until you exit

    Now if you do the "ping server-b" it should repond something like:

    Pinging server-b.otherdomain.com [192.168.1.2] with 32 bytes of data: Reply from 192.168.1.2: bytes=32 time=12ms TTL=64 Reply from 192.168.1.2: bytes=32 time=9ms TTL=64

    Now try to again to execute the distributed transaction.

    0 讨论(0)
  • 2021-01-06 08:09

    I had the luxury of safely restarting the SQL Server services on both sides of the Linked Server connection. I did not have to reboot the machines.

    0 讨论(0)
  • 2021-01-06 08:09

    Have you tried using openquery?

    insert into table select * from openquery(myservername, 'exec mydatabase.dbo.mystoredproc param1, param2, param3')
    
    0 讨论(0)
  • 2021-01-06 08:21

    Well, after following lots of tutorials and researching a lot about it, I had changed all the configuration I thought was necessary for it to work, but it still didn't.

    Today we had to force a power reboot on our development server because of a faulty no-break, and when we booted up the server, guess what? It works!

    So just for the record, I've changed some specific MSDTC configuration, added it as a linked server and allowed RPC IN and OUT, and changed the RPC configuration for 'NO AUTHENTICATION REQUIRED' or something like that.

    I remember reading somewhere that after you changed this configuration, a reboot was required, even though Windows says that it has already restarted the service.

    I had rebooted my server like... twice since I changed it, and it still didn't work. But as today, after a complete turn off and turn on, it works!

    As for the syntax, I kept the same.

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