简体   繁体   中英

How to Insert into remote table using Linked server withint Transaction?

My Linked server is setup correctly , I am able to perform below query.

INSERT INTO [RemoteServer].[Table] SELECT * FROM [LocalServer].[Table]

However when I do the same thing within transaction

BEGIN TRAN INSERT INTO [RemoteServer].[Table] SELECT * FROM [LocalServer].[Table] COMMIT TRAN

I get Errors like

OLE DB provider "SQLNCLI" for linked server "66.70.123.202" returned message "No transaction is active.". Msg 7391, Level 16, State 2, Line 3 The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "66.70.123.202" was unable to begin a distributed transaction.

检查MS DTC服务是否在两台服务器上运行,并且配置正确以允许分发查询。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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