PHP网站-在链接服务器中插入-无法开始分布式事务

问题描述

问题我有一台装有 sql Express 的计算机以及用于测试的网站。该网站使用PHP编码,并且当调用以下 INSERT 写入sql Express数据库时,该网站可以正常工作。但是,我们正在尝试使用此 INSERT 从具有sql Server的另一台服务器的另一数据库中的表中写入数据。 当前,我们已创建到该服务器的数据库链接,并从所需表中创建了视图 nav_integration 。因此,基本上,我们尝试使用视图在该表中插入。

但是它返回如下所示的错误

[Microsoft][ODBC Driver 13 for sql Server][sql Server]The operation Could not be performed because OLE DB provider "sqlNCLI11" for Linked Server "cmsrvsql1" was unable to begin a distributed transaction.

首次尝试: 更改两台服务器上本地DTC的安全性配置以允许交易,还创建了防火墙规则以允许DTC通信。

第二次尝试:链接服务器的用户权限更改为处于“模拟”活动状态的本地用户。连接成功建立,但没有解决问题。

重要:当我在sql Server Manager Studio中使用插入 SELECT 进行查询时,从sql Express服务器到另一个服务器工作正常。

INSERT INTO nav_integration( [No_],[Description],[Search Description],[Description 2],[FA Class Code],[FA Subclass Code],[FA Location Code],[vendor No_],[Main 
Asset_Component],[Component of Main Asset],[Warranty Date],[Responsible Employee],[Serial No_],[Last Date Modified],[Next Service Date],[Inactive],[marca_Fabricante],[Modelo],[Descricao da Garantia],[External FA Type],[Equivalent FA],[Ownership date],[Active FA],[FA Description Aux],[Unit of Measure],[Dimension Value Code],[Hour Expense],[Day Expense],[Install Expense],[Install Time],[Uninstall Time],[Install Unit],[Uninstall Unit],[Link Document],[Tag],[Favourite],[Acquisition Cost],[Counter],[Quantity],[Status],[periodicity],[Action],[Operational],[Borrowed],[External Entity],[Borrow Date],[Return Date],[Borrow Entity],[CodPedidoCabimentacao],[Purchase Invoice],[Purchase Invoice Lines],[Document Management URL],[Original FA],[Valor Para Seguro] ) 
VALUES('190306',?,'P-4','','01.566899','0','0198','030307141218011460','2020- 
09-14','Chauvet','colordash batten quad 12','2019-04-15','1','US','UN','11',0.00,1,UPPER(''),310.00){Projector Barra Laaad} 
{PROJECTOR BARRA LAAAD}{}<>00000<>7391<>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)