Linked Server/OPENQUERY problems

  • I am having a strange problem.  I have created a Linked Server to link SAGE Line50 data (using the ODBC).  I can issue the following statement and get the answer 30 - which is correct.

    SELECT *

    FROM OPENQUERY(LINE50, 'Select COUNT(*) From SALES_LEDGER')

    If I run the following statement I get only the first record.

    SELECT *

    FROM OPENQUERY(LINE50, 'Select COUNT(*) From SALES_LEDGER')

    I have tried only returning 1 or 2 columns with no change and I have also tried a number of different tables.

    Has anyone got any ideas?

  • This was removed by the editor as SPAM

  • What is the result if 4 part naming is used to retrieve data??...i.e SELECT * FROM <servername>.<databasename>.<ownername>.<tablename> -- does this result in the rows being returned??

    and perhaps using SET FMTONLY OFF in the linked server query might help...i.e.

    SELECT * FROM OPENQUERY(LINE50,'SET FMTONLY OFF SELECT * FROM SALES_LEDGER')

    HTH

  • Thankyou for the repley.  No joy with the SET FMTONLY OFF.  I get the following error returned.

    An error occurred while preparing a query for execution against OLE DB provider 'MSDASQL'.

    The 4 part naming returned this error.

    Invalid schema or catalog specified for provider 'Local Server'.

    I am able to to exactly what I am trying with Pegasus Opera Accounts which use data stored in FoxPro.  I am wondering if the Sage ODBC Driver is causing the problem.  I have had no joy at the Sage Developers Forum as yet.

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

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