Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Let's say I'm querying a big list but only need a subset of the rows for demo purposes. What's the easiest way to say "Top 100 Rows" or similar in CAML? Can't seem to find a statement out there. Thanks!

share|improve this question
add comment

2 Answers

Are you using SPQuery object? If so, you can use the RowLimit property of SPQuery object.

share|improve this answer
    
Not quite, I'm using a SSIS Datasource component which queries from SharePoint lists. It takes in CAML so that's feasible, but setting row limit wouldn't be (though the code is open source, a few tweaks could fix that). –  tekiegreg Oct 21 '10 at 1:53
add comment

You can do this with the RowLimit element.

MSDN: http://msdn.microsoft.com/en-us/library/dd588460(office.11).aspx

From what I can find, it should look something like this:

<RowLimit Paged="TRUE">100</RowLimit>

Never used it myself though.

share|improve this answer
add comment

Your Answer

 
discard

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.