简体   繁体   中英

Linked server in sql server 2005

we have two servers one in local (windows server 2003) and one in godaddy(windows server 2008), installed sql server 2005 in both the servers and created linked servers in both the servers.

we have enabled trigger in godaddy server for one sampletbl table, whenever we are trying to insert the data from godaddy database to local database using the trigger enabled, then we are facing the below error.

OLE DB provider "SQLNCLI" for linked server "211_TEST" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Procedure 36to211, Line 8
The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "211_TEST" was unable to begin a distributed transaction.

Trigger code is as follows :

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[36to211] on [dbo].[SampleTbl]
FOR INSERT
as
Declare @a int;
Declare @b int;
Declare @c int;
select @a=TETS_DET,@b=TEST_DET2,@c=TEST_DET3 from SampleTbl
insert into [211_TEST].[MAPBULLION].[dbo].[TEST1]
(TETS_DET,TEST_DET2,TEST_DET3)
values
(@a,@b,@c)

here [211_TEST] is the linked server name, MAPBULLION is the database in local server and TEST1 is the table name in local server.

Checked all the MSDTC settings and they are as per the desire

Please provide the solution.

This is the query that we are trying to execute to insert the data from godaddy server to local server:

insert into sampletbl (TETS_DET, TEST_DET2, TEST_DET3)
VALUES ('5', '6', '7') 

First hit on google for "sql server distributed transaction linked server"

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/523116d4-4c8e-43a8-abf4-e705ffaa68c8/distributed-transactions-fail-on-linked-server?forum=sqldatabaseengine

Says something about it being a known issue ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM