链接服务器:"No transaction is active." 和 "unable to begin a distributed transaction"

linked server : "No transaction is active." and "unable to begin a distributed transaction"

我的本地机器上有一个 CRM 软件。在软件的 SQL 数据库中,我添加了一个链接服务器(我们的测试网站和我们的测试数据库:Windows Small Business Server 2011)。 链接服务器设置为

RPC => True
RPC Out => True
Enable Promotion of Distributed Transaction => True

我创建了一个触发器,以便当一家公司通过 CRM 软件进行更新时,它会启动一个存储过程,例如:

proc [dbo].[Proc_UpdateInstitutionWeb]
@Company_ID nvarchar(50)

as

DECLARE @id int = 0;

BEGIN TRY
    SET @id = CONVERT(int, @Company_ID)
END TRY
BEGIN CATCH
    ...
END CATCH

update [myserver].[mydatabase].[dbo].[company] 
set founded = 2000
where company.id= @id

当我在 CRM 中进行更改时,这不起作用。因此,我在 CRM SQL 数据库中尝试了对公司 table 的简单更新查询,但它抛出了以下错误:

OLE DB provider "SQLNCLI10" for linked server "myserver" returned message "No transaction is active.". Msg 7391, Level 16, State 2, Procedure Proc_UpdateInstitutionWeb, Line 34 The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "myserver" was unable to begin a distributed transaction.

这是我尝试做的事情:

在我的电脑和测试服务器上:

None 这个问题解决了吗。我应该怎么办?

谢谢

我脱发很多天后,这是对我有用的,以防有人需要。

首先我禁用了自动生成 6to4 地址。

 1. Open Command
 2. Type the command `netsh interface 6to4 set state disabled`

然后我限制了两台机器上的DCOM端口范围

 1. Start -> Run -> Type DCOMCNFG
 2. Go to the properties of the My Computer node under the Computers folder underneath Component Services. 
 3. Under the My Computer Properties look under the Default Protocols tab. 
 4. Over there make sure that Connection-oriented TCP/IP is selected and then click on Properties. 
 5. No range was listed. I added one. Example 5000-5100

我认为之前在 Component servicesServices 中对 DTC 所做的所有工作也需要此工作。

我最终得到了与 DTCPing.exe 和以下参考文献一起使用的解决方案: