inserting to a local table from a linked stored procedure

前提是你 提交于 2019-12-10 20:02:23

问题


I have a sproc that is called from .net code which does an update on a local table and then is supposed to insert to a different local table values that are obtained from a remote procedure call to a linked server.

I get this error message every time I try to insert the results from the linked server. If i take out the insert into statement, but leave the remote procedure call in place, it works fine. Here is the error:

System.Data.SqlClient.SqlException: The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "MyLinkedServer" was unable to begin a distributed transaction. OLE DB provider "SQLNCLI10" for linked server "MyLinkedServer" returned message "The transaction manager has disabled its support for remote/network transactions.".

this is the simple code I'm using:

INSERT INTO MyLocalTable
EXEC [MyLinkedServer].[MyRemoteDatabase].[dbo].[usp_MySproc] @MyParam

any ideas what's wrong here or any suggestions of how I can insert the results from the remote procedure to a local table?


回答1:


one of the sql guys was able to resolve this by changing the "enable promotion of distributed transactions" to false.



来源:https://stackoverflow.com/questions/13017428/inserting-to-a-local-table-from-a-linked-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!