SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


OLE DB provider "SQLNCLI11" for linked server "linkedservername" returned message "The transaction...


OLE DB provider "SQLNCLI11" for linked server "linkedservername" returned message "The transaction manager has disabled its support for remote/network...

Author
Message
ayemya
ayemya
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3113 Visits: 1254
I have a database in SQL 2014 AG group.- two nodes. On both nodes, a linked server is set up. I am selecting data from a table from a database from AG group and insert into a linked server (a database from another AG group) . only insert statement is in Transaction block. It is not a distributed transaction.
Why do i get the following error.

OLE DB provider "SQLNCLI11" for linked server "LinkedserverListener" returned message "The transaction manager has disabled its support for remote/network transactions.".
Msg 7391, Level 16, State 2, Line 2
The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "LinkedServerListener" was unable to begin a distributed transaction.

Sample code is a below.

Drop table #Myatran
Select 'ABC' name into #Myatran
------------------------------------------------------------------------------------------------------------------
DECLARE @pndstop_ps NVARCHAR(4000)
SET @pndstop_ps =
N'
INSERT INTO '+ 'linkedserver'+'.DB.dbo.MyaTEST(Name) SELECT name FROM #Myatran
'
SET XACT_ABORT ON
BEGIN TRANSACTION

EXEC sp_executeSQl @pndstop_ps


SET XACT_ABORT OFF

Thank you.
Joe Torre
Joe Torre
SSCertifiable
SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)

Group: General Forum Members
Points: 7083 Visits: 1342
Your temp table will not be accessible as sp_executesql runs your SQL in a different session then the one you create the temp table in. You would need to make it global ##Myatran. Also enable distributed transaction, RPC and RPC out on the linked server. when you insert from a local table into a table on a linked server, that is a distributed transaction.
Sue_H
Sue_H
SSC Guru
SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)

Group: General Forum Members
Points: 69561 Visits: 14480
ayemya - Tuesday, March 6, 2018 2:22 PM
I have a database in SQL 2014 AG group.- two nodes. On both nodes, a linked server is set up. I am selecting data from a table from a database from AG group and insert into a linked server (a database from another AG group) . only insert statement is in Transaction block. It is not a distributed transaction.
Why do i get the following error.

OLE DB provider "SQLNCLI11" for linked server "LinkedserverListener" returned message "The transaction manager has disabled its support for remote/network transactions.".
Msg 7391, Level 16, State 2, Line 2
The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "LinkedServerListener" was unable to begin a distributed transaction.

Sample code is a below.

Drop table #Myatran
Select 'ABC' name into #Myatran
------------------------------------------------------------------------------------------------------------------
DECLARE @pndstop_ps NVARCHAR(4000)
SET @pndstop_ps =
N'
INSERT INTO '+ 'linkedserver'+'.DB.dbo.MyaTEST(Name) SELECT name FROM #Myatran
'
SET XACT_ABORT ON
BEGIN TRANSACTION

EXEC sp_executeSQl @pndstop_ps


SET XACT_ABORT OFF

Thank you.


As Joe said, it is a distributed transaction. You don't need to use begin distributed transaction for it to be promoted to a distributed transaction. You do need to configure the Distributed Transaction Coordinator. There are some steps in this related article - refer to the Distributed Transaction Coordinator section for the steps:
Setting up linked servers with an out-of-process OLEDB provider

Sue



ayemya
ayemya
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3113 Visits: 1254
I appreciate your answers. It explains why my transaction throws errors. we have SQL 2014 AG and it doesnt support DTC. I am trying to think a workaround. Thank you.
Sue_H
Sue_H
SSC Guru
SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)

Group: General Forum Members
Points: 69561 Visits: 14480
ayemya - Wednesday, March 7, 2018 10:05 AM
I appreciate your answers. It explains why my transaction throws errors. we have SQL 2014 AG and it doesnt support DTC. I am trying to think a workaround. Thank you.


You should be able to do it in Powershell - you can use write-datatable if you are using the SQLServer module. Otherwise the same cmdlet has been written as a function you can download from the TechNet script repository:
Write-DataTable

Sue



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search