We have a linked Server against DB2 on SQL Server 2005. When we tried putting a simple query result set from the linked sever into a temp table return this error.
OLE DB provider "MSDASQL" for linked server "SOMEDSN" returned message "[IBM][CLI Driver] SQL0998N Error occurred during transaction or heuristic processing. Reason Code = "16". Subcode = "2-8004D026". SQLSTATE=58005 ". Msg 7391, Level 16, State 2, Line 21 The operation could not be performed because OLE DB provider "MSDASQL" for linked server "SOMEDSN" was unable to begin a distributed transaction.
DECLARE @FilterCode varchar(20);
Set @FilterCode = '11122';
Create Table #TmpTable (
Id Int
)
Insert Into #TmpTable
EXEC ('Select A.Id From SCM1.DB2TBL1 A Where A.FilterCode = ?', @FilterCode) At SOMEDSN;
The Exec works just fine with correct result set displayed, but as soon as we tried the result set into the temp table, then we get the error.
I searched here and many other places and tried the followings.
The table contains very many rows. We need to execute the query on the DB2 side to reduce the result set based on the parameter.
Any help would be greatly appropriated!
Have you started the MSDTC service (DTC)?
Under Windows 2008:
If that does not work, try disabling connection pooling .
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.