Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OLe DB provider "SQLNCLI" for linked server was unable to begin a distributed transaction

Tags:

sql

sql-server

I am trying to call a stored procedure in SQL Server 2008 and store the fetched data into a local temp table.

When I try to run it, I receive the following error:

The operation could not be completed because OLe DB provider "SQLNCLI" for linked server was unable to begin a distributed transaction

My code is as follows :

create table #temp(
    col1 as int,
    col2 as varchar(50)
)

insert into #temp
exec [192.168.0.9].[db1].[dbo].[tablename] @usr_id=3
like image 545
user2420214 Avatar asked Sep 06 '13 12:09

user2420214


1 Answers

You can prevent using distributed transactions for the linked server by setting server option 'remote proc transaction promotion' to 'false':

EXEC sp_serveroption 'servername', 'remote proc transaction promotion', 'false'

Here's the same issue

like image 153
Vladimir Makarov Avatar answered Oct 21 '22 16:10

Vladimir Makarov