Error OPENQUERY Maximum length is 8000

  • Hi, 
    I have a query inside a openquery:
    SELECT
    RE.*
    FROM OPENQUERY(PROD,
    'SELECT XXXX ') RE

    This is too long. Excede maximum length: 8000. 
    How can i write the query without this error? I can´t minimize the query, because I need many tables and make many cases inside the query. 
    thanks

  • Helical Joan2 - Thursday, March 22, 2018 6:22 PM

    Hi, 
    I have a query inside a openquery:
    SELECT
    RE.*
    FROM OPENQUERY(PROD,
    'SELECT XXXX ') RE

    This is too long. Excede maximum length: 8000. 
    How can i write the query without this error? I can´t minimize the query, because I need many tables and make many cases inside the query. 
    thanks

    You may need to rewrite the query as a view on the remote (linked) server and select from that view in the OPENQUERY.

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

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