从远程exec存储过程插入本地表

时间:2012-09-18 15:52:21

标签: sql-server sql-server-2008

我试过这个:

insert into MyTable (col1, col2... coln)
exec remoteServer.remoteDB.dbo.StoredProcedure.

The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.

本地服务器是SQL 2000,远程是2008。

有什么想法吗? 当我尝试执行存储过程时,事情顺利进行,我得到结果SELECT所以问题在于复制。

我已尝试启用MSDTC及其配置(如here所示)

1 个答案:

答案 0 :(得分:1)

假设您尚未尝试过此操作,请尝试将此标注包装在DISTRIBUTED TRANSACTION

http://msdn.microsoft.com/en-us/library/ms188386.aspx

BEGIN DISTRIBUTED TRAN

...

COMMIT TRANSACTION