Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:03:23+00:00 2026-05-31T11:03:23+00:00

I had a question earlier (that was solved) about why I was limited to

  • 0

I had a question earlier (that was solved) about why I was limited to two paramters in CAML.

For reference: Trouble with OR in Sharepoint CAML

What I now want to know is, can I reformat this CAML query to accept 5 OR parameters, where I collect ALL items from a list WHERE I find a match for any of the 5 parameters.

The reason I ask, is I am limited to a Designer deploy of a Sandbox solution web part. These solutions have very limited resources, and I want to have as efficient a query as possible, and most LINQ solutions don’t alter the SQL calls as efficiently as CAML does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:03:25+00:00Added an answer on May 31, 2026 at 11:03 am

    Yes. There is no set limit to OR‘s. (Due to how the CAML is turned into SQL there is a maximum depth of about 2000 chained operators, but this can be increased by balancing the query tree.)

    Just keep nesting the OR‘s for the desired combination. I recommend using XNode/XElement and recursion to create a function to do this “magically”.

    Note that the nesting is very simple (I have written in in S-expression form, which is also prefix to show what happens, along with an infix C# conditional equivalent):

    1: (OR a b)                => a || b                => a || b
    2: (OR (OR a b) c)         => (a || b) || c         => a || b || c
    3: (OR (OR (OR a b) c) d)  => ((a || b) || c) || d  => a || b || c || d
    

    Note that each new OR just “wraps” the previous expression.

    Performance is based on the performance of the underlying SQL Server database and varies based on which field is being used in the CAML. If the field is part of an index then the operations are very fast for “equals” or “range” conditions. Even if the columns are not part of an index, for “smallish” sized lists it is still a very fast operation.

    Best bet is to “just try it” with a tool like the U2U CAML Query Builder (“Windows Version”) and see what performance issues there are, if any.

    Happy coding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i had asked earlier about the same kind of question but that was in
I had posted another question earlier about deployment with Passenger. That problem turned out
I am concreting a question I had earlier. I have two classes in C++
This question is a follow up to an earlier question I had that was
I learned about semaphores from an earlier question I had today, and I stll
I had asked a question about this earlier, but it didn't get answered right
So, I had a question earlier about mod_rewrite which you find here mod_rewrite changing
This is a question that came from an earlier problem I had . Basically,
The following question is related to a question that I had asked earlier: Help
Hi I posted a question a little earlier and I had some replies that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.