0

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.

  1. sp_configure 'remote proc trans', 0
  2. On Linked Server Properties > Server Options set "Enable Promotion of Distributed Transactions" to false. I did not see this option.
  3. On Linked Server Properties > RPC, RPC out and distributor are set to value TRUE
  4. Used Openquery, but it cannot use dynamic SQL or pass parameters.

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!

1 Answer 1

0

Have you started the MSDTC service (DTC)?

Under Windows 2008:

  • From Administrative tools->Component services->Computers->My computer: Local DTC. Right click Properties, go to the MSDTC tab and select "Security Configuration".
  • Enable checkbox for "Network dtc access" and "Allow outbound".
  • Enable checkbox for "No Authentication Required"

If that does not work, try disabling connection pooling.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! We will try that tomorrow with our DBA.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.