'Error The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server was unable to begin a distributed transaction
I have an AAA server that connects to a BBB server through Linked Server, only queries are executed through stored procedures, if I run the procedure on the same AAA server the query works fine, now, when I run it in the app randomly I get the next error.
In the procedures, temporary tables are used where data that is extracted from the linked server is inserted. Here is an example:
CREATE PROCEDURE [dbo].[capsa_spcc_datos]
(
@vs_POSITION_ID NVARCHAR(MAX)
)
AS
BEGIN
-------------------------------------------------
IF OBJECT_ID('tempdb..#Unidades') IS NOT NULL
BEGIN
DROP TABLE #Unidades
END
IF OBJECT_ID('tempdb..#UnidadesDatos') IS NOT NULL
BEGIN
DROP TABLE #UnidadesDatos
END
IF OBJECT_ID('tempdb..#DatosPosicion') IS NOT NULL
BEGIN
DROP TABLE #DatosPosicion
END
IF OBJECT_ID('tempdb..#prcs') IS NOT NULL
BEGIN
DROP TABLE #prcs
END
IF OBJECT_ID('tempdb..#POSORG') IS NOT NULL
BEGIN
DROP TABLE #POSORG
END
IF OBJECT_ID('tempdb..#nivel') IS NOT NULL
BEGIN
DROP TABLE #nivel
END
Data: We have changed the database linked to a new BBB server and the problems started, the strange thing is that from time to time it works fine and suddenly it stops working showing the indicated error
We have reviewed these issues and were unable to resolve the case: MSDTC, network problems, firewall, dns, ports, permissions.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
