Querying AS 400

  • I have an AS 400 linked server that I am querying from sql server using the open query method.  The result that are returned using the syntax:

    SELECT * FROM OPENQUERY('SELECT * FROM library.tbl')

    are dramitically different from the expected results:

    For example, when I run the above query 40 records are returned.

    AS opposed to when I run the query

    SELECT * FROM OPENQUERY('SELECT count(*) FROM library.tbl')

    Which returns 1 record with the value 200,000.

    Why am I not getting 200,000 records returned from my first query?

    Isn't the SELECT * FROM syntax equivalent in ANSI SQL to T-SQL?

     

     

     

  • we have this happen periodically and it has to do with the settings of either your ODBC connection for the 400 or the settings on the linked server properties.  Make sure all your settings allow the rpc protocalls that you are using...

  • Thanks Kelly,

    This is what I found too.  It was the ODBC settings.  

Viewing 3 posts - 1 through 2 (of 2 total)

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