开发者

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

开发者 https://www.devze.com 2023-01-03 03:22 出处:网络
My Linked server is setup correctly , I am able to perform below query. INSERT INTO [RemoteServer].[Table]

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.


Check if MS DTC service is running on both servers and it is configured correctly to allow distribured queries.

0

精彩评论

暂无评论...
验证码 换一张
取 消