一同事在测试服务器(系统:Windows 2008 R2 Standard 数据库:SQL SERVER 2008 R2)通过链接服务器test使用分布式事务测试时出错,出错信息如下:
set xact_abort on
begin tran
update test.mydb.dbo.test_one set name='test' where id= 3 ;
commit
OLE DB provider "SQLNCLI10" for linked server "test" returned message "The transaction manager has disabled its support for remote/network transactions.".
消息 7391,级别 16,状态 2,第 5 行
The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "test" was unable to begin a distributed transaction.
出现这个错误时因为这台服务器,或者链接服务器那台服务器没有配置好MS DTC(Microsoft Distributed Transaction Coordinator 微软 分布式事务协调器)。
首先确保开启了 'remote access'、 'remote admin connections'、 'remote proc trans'选项。