Problem with SQLNCLI related servers. "No transaction is active"

I try to execute a stored procedure and just paste its results into a temporary table, and I get the following message:

The operation could not be completed because the OLE DB provider "SQLNCLI" for the linked server "MyServerName" could not start the distributed transaction. The OLE DB provider "SQLNCLI" for the linked server "MyServerName" returned the message "No transaction is active."

My query looks like this:

INSERT INTO #TABLE
EXEC MyServerName.MyDatabase.dbo.MyStoredProcedure Param1, Param2, Param3

The exact column number, names, problem is not the result.

MSDTC is enabled and running on both computers; it also calls a remote procedure.

The machines are not in the same domain, but I can perform remote requests from my machine and get the result. I can even execute the stored procedure and see its results, I just can’t insert it into another table.

Help me please?:)

EDIT


Oh, I forgot to mention, the stored procedure does not fire any triggers. It only inserts records into temporary tables that it creates to process data.

+3
source share
3 answers

Well, after several lessons and learned a lot about it, I changed the whole configuration, which, it seemed to me, was necessary for her work, but she still did not.

- , , , ? !

, MSDTC, RPC IN OUT, RPC " " - .

, - , , Windows , .

, ... , , . , , !

, .

+3

DNS IP-.

, server-a.mydomain.com, - server-b.otherdomain.com, -a "ping-server-b" ( ).

: " Ping --b. , ". .

> > > a > -ul > a > > DNS > DNS- . : mydomain.com, : otherdomain.com OK,

, "ping server-b", - :

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

.

+1

Have you tried using openquery?

insert into table select * from openquery(myservername, 'exec mydatabase.dbo.mystoredproc param1, param2, param3')
-2
source

Source: https://habr.com/ru/post/1747609/


All Articles