SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the following Query to retrieve the latest documents of the current user:

            <FieldRef Name='FSObjType'></FieldRef>
            <Value Type='Text'>0</Value>
                <FieldRef Name='Author' />
                <Value Type='Integer'><UserID/></Value>
                <FieldRef Name='Editor'/>
                <Value Type='Integer'><UserID/></Value>

 <FieldRef Name="Modified" Ascending="FALSE"/>

It is failing if the total number of documents in the site collection is higher than the threshold limit, even if the return result of the above query is only a few documents.

How to change the above query so that i don't risk exceeding the threshold.

Example, user1 has changed 5 documents in a list that contains 7000 documents. i want to display those 5 documents using the above query. If the list threshold is less than 7000, i get an exception. How to change the above query so not to exceed the threshold limit?

share|improve this question

Pretty sure there's a rowLimit to apply. You should be able to add this using this element in CAML


You can see how to apply this on MSDN.


Per your comment below, I think perhaps the ContentIterator is more what you need (code sample included). This should allow you to iterate over each matching item.

share|improve this answer
I believe rowlimit will execute after getting the result, which has no effect, no? – Zee99 Mar 28 '11 at 14:26
I suspect you're right. I'll share other thoughts in a different answer. – Neil Richards Mar 28 '11 at 16:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.