简体   繁体   English

在 SQL Server 2008 R2 中使用分布式事务时出错

[英]Error using distributed transaction in SQL Server 2008 R2

I am using SQL Server 2008 R2.我正在使用 SQL Server 2008 R2。

I am getting the following error when I try to execute a SP from java side.当我尝试从 java 端执行 SP 时,出现以下错误。 The same SP is running well when I use query browser to run.当我使用查询浏览器运行时,相同的 SP 运行良好。

I have tried using hot fix also but it is not working.我也尝试过使用热修复,但它不起作用。

ERROR:: The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "server name" was unable to begin a distributed transaction.错误:: 无法执行操作,因为链接服务器“服务器名称”的 OLE DB 提供程序“SQLNCLI10”无法开始分布式事务。 when executed in transaction在事务中执行时

Inside SQL Server Management Studio, expand Server Objects, then Linked Server, then right click on the linked server in question and choose 'Properties.'在 SQL Server Management Studio 中,展开 Server Objects,然后是 Linked Server,然后右键单击相关的链接服务器并选择“Properties”。 Select the 'Server Options' page, and make sure 'Enable Promotion of Distributed Transactions' is set to 'False' Select 'Server Options' 页面,并确保'Enable Promotion of Distributed Transactions' 设置为 'False'

Or you can do it with T-SQL :或者你可以用T-SQL来做:

USE master;
EXEC sp_serveroption '<<your linked server name>>', 'remote proc transaction promotion', 'false';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM