I am using SPSiteDataQuery to get all matched items from all lists in site collection. Results set is really large, so I want to limit the results to 1000 or 10K, process these items and then iterate through remaining matched items. I am looking for somewhat similar property to ListItemCollectionPosition in SPQuery, that will allow to loop through the result-set till all items are processed.

Or is there any way in which I dont have to get all result-sets at once, and then get 10K results and process them in loop till all matched items are done processing. I really dont want to get 1 million results at once.



Sorry but SPSiteDataQuery only supports limiting the number of results not paging to the next set.

If you're using 2010 Server you can use ContentIterator

But if you're using Foundation then your only option is to put some hidden column into all the lists which you can use to break the items into sets.

  • That's a dirty workaround but sadly true. +1 – Hugh Wood Dec 5 '12 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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