About the linked server function OpenQuery

  • The define of OpenQuery in MSDN is as following:

    OPENQUERY ( linked_server , 'query' )

    Can anyone know what the max length of 'query' is?

    I found this funtion wouldn't work when the size of query

    exceeds 9k. It is possible to get the prototype of suchlike functions?

    Thnaks in advance!

  • this may never work, but just for kicks, have you tried breaking your query into multiple strings (varchar variables). I belive there is like an 8K limit on the input string, but on occasion you can fool it when using multiple variables as such:

    OPENQUERY ( linked_server , @Qry1 + @Qry2)

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

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