Linked server and transaction
From: DaveK (anonymous_at_discussions.microsoft.com)
Date: 06/03/04
- Next message: Uri Dimant: "Re: Linked server and transaction"
- Previous message: Tony C: "Re: OSQL Question"
- Next in thread: Uri Dimant: "Re: Linked server and transaction"
- Reply: Uri Dimant: "Re: Linked server and transaction"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Jun 2004 02:31:03 -0700
Hi,
I have a problem I'd like some advice on. Here is the situation. I have an sp which queries data using a linked server. Running the sp works fine. Now I've read about the loopback and transaction issue but I can't explain this:
For whatever reason one of our developers has to run a number of sp's and put the result into a temp table and then output those results. It shouldn't matter what the sp is because it's just a simple select from two sql server (all 8.00.919).
The following works very quickly:
DECLARE @Sql VARCHAR(100)
SELECT @Sql = 'MyLinkedServerSp'
EXEC (@sql)
It returns an integer in about 1 second.
However, the following errors after about 4 minutes:
CREATE TABLE #test (Col1 INT)
DECLARE @Sql VARCHAR(100)
SELECT @Sql = 'MyLinkedServerSp'
INSERT INTO #test
EXEC (@sql)
The error is:
Server: Msg 7391, Level 16, State 1, Procedure MyLinkedServerSp, Line 40
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
Why does that fail but the first one work and where is the distributed transaction being instigated? This is all via SQL Query Analyser.
Thanks
Davek
http://www.sqlporn.co.uk
- Next message: Uri Dimant: "Re: Linked server and transaction"
- Previous message: Tony C: "Re: OSQL Question"
- Next in thread: Uri Dimant: "Re: Linked server and transaction"
- Reply: Uri Dimant: "Re: Linked server and transaction"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|