Linked Server and Missing records!

  • Ok, this is one of the strangest things I have ever seen.  First thing, the background: we have a DB2 system that we want to take out all the records from a handful of tables and place the data in SQL Server.  There will be some manipulation to the data; but, even before that the strangest thing is going on.  The number of records that I get back using a "select *" is less than the number of records that exist in the table!  Here are the results listed belolw, I am using a linked server through ODBC using IBM iSeries ODBC drivers to connect to the DB2 system and the open query statement.

    select

    * from openquery(LCP_SAP, 'select count(*) from R3LCPDATA.LTAK')

    - 3834380 records (verified on DB2 to be the same number)

     

    select * from openquery(LCP_SAP, 'select * from R3LCPDATA.LTAK')

    - 3834369 records

     

    So, 11 records are missing, and where did they go? To note, it's always 11, and I bet the same 11 that are missing everytime.  A buffer thing, a memory thing, etc?  I have no idea whatsoever, any ideas here would be really appreciated!  Thanks!

  • Could it be some NULL records exist?

    Check the ANSI NULLs setting in ODBC.

  • I had similar experience. It was related to some kind memory thresh in ODBC driver.

    You may check by selecting smaller table to verify.

  • We had a similar experience, and we fixed, almost for the time being, changing some advanced parameters in the Odbc connection.

    More specifically, we changed this two parameters:

    Performance Tab -> Advanced -> LOB was set to the highest value (16384)

    Performance Tab -> Advanced -> Using block grouping..... was unchecked

  • Josep is correct.  Change the settings for the ODBC DSN so that the

    checkbox under Performance -- > Advanced for "Use blocking with a fetch of 1 row is UNCHECKED.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply