在存储过程中,我使用了下面的语句。但是当我运行存储过程时,它抛出了分布式事务错误。
Declare @res int
Declare @mes as varchar(100)
DECLARE @Result TABLE (
result INT,
mesage VARCHAR(100))
Insert @Result (result, mesage)
Exec [MySpeNet].[dbo].[GetMemberShipStatus]'3319994'
select @res = result, @mes = mesage from @Result例外:
Msg 7391, Level 16, State 2, Procedure GetMemberShipStatus, Line 19
The operation could not be performed because OLE DB provider "OraOLEDB.Oracle"
for linked server "ASPQA" was unable to begin a distributed transaction.或
有没有其他方法可以在不创建临时表的情况下存储结果和消息?
发布于 2011-09-06 05:30:18
启用选项
在组件服务中的本地DTC属性的“安全”选项卡上。
要运行,请键入comexp.msc.
发布于 2015-12-17 05:37:06
这是对我有效的方法:
在SQL Server Management Studio中,展开服务器对象,然后展开链接服务器,然后右键单击有问题的链接服务器并选择“属性”。选择“服务器选项”页面,并确保“启用分布式事务升级”设置为“False”。
或者你也可以用T-SQL来实现
USE master;
EXEC sp_serveroption '<<your linked server name>>', 'remote proc transaction promotion', 'false';https://stackoverflow.com/questions/6999906
复制相似问题