Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

queryrange length limitation

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

hi,

i am dynamically building comma separated values to be passed in query range. It would be very big string and may go upto 8000 characters.

Can anyone please let me know what's the maximum allowed length for the queryvalue in queryrange? Thanks.

*This post is locked for comments

  • Suggested answer
    RE: queryrange length limitation

    maximum allow limit query range is 4095chars

  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: queryrange length limitation

    That's a crazy number! You shouldn't be doing anything like that!

    If you tell us what business problem you're trying to solve, we should be able to suggest better technical design; one that actually will work.

  • ismaelivan Profile Picture
    ismaelivan 570 on at
    RE: queryrange length limitation

    It didn't work for me to do it multiple times 

    (as an example I send the same value several times, if I send it 2089 times it gives error)

    6076.c1.PNG

    [Microsoft] [SQL Server Native Client 10.0] [SQL Server] The remote procedure call protocol (RPC) sequence of the incoming tabular data stream (TDS) is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.

    But if I send it 2088 times, it works!!


    ]
  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: queryrange length limitation

    I've shown an example in Lines for multiple headers.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: queryrange length limitation

    Hi VDY,

    Refer to this blog post of mine regarding the solution suggested by Martin. You need to apply range on one field multiple times so that the result is an OR condition. This way you will not be required to pass a big string.

    http://basicax.blogspot.com.au/2012/12/x-code-to-define-or-conditions-in.html

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: queryrange length limitation

    Hi Martin ,

    can you please  provide example?

    Thanks

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    RE: queryrange length limitation

    A TempDB table would be a good choice in this case. Also, another alternative to using a comma-separated list of values in a single range is creating several ranges (each with its own value) for the same field.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: queryrange length limitation

    That totally depends upon your implementation either you can achieve via permanent or temporary table. Yes you are right, if you are implementing it via permanent table you can add it in QBDS.

    Hope this helps you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: queryrange length limitation

    Is that the physical AOT table you created to dump those range values?

    i guess, if it's AOT table, then only you can add it in QBDS for joining with other table.

    am i right?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: queryrange length limitation

    I created a separate table and dump my range values in it. After that I make an exists join with the newly created table containing range values with my query.

    Hope this helps you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans