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

We are currently designing a where there are many sites, each site contains a list.

The list in each of these sites has the same fields.

We would like to create a report based on the information in these lists.

Is there a built in way to extract this information? Or do we just have to loop through each site and pull it out?

share|improve this question
up vote 4 down vote accepted

If all your sites are in the one site collection, and you can use the SPSiteDataQuery object. It helps if you have a particular content type to query for.

Also, if you've got the publishing features enabled on your site collection, you can use the content query web part. Internally this uses the SPSiteDataQuery class, but it gives you a user interface too.

share|improve this answer
Thanks that fits very well with what we are trying to do. – Shiraz Bhaiji Dec 9 '10 at 8:50
It's not recent, but this might be useful:… – Andy Burns Dec 10 '10 at 15:35

SharePoint does not allow to use the SPSiteDataQuery over different site collections at the same time. Plus you need the same content type or list template.

If you want to aggregate over different site collections, you need to do it yourself with the foreach approach.

Another option is to install the Search Server and perform a Search Query. The advantage is that queries will be faster. The drawback is that data are not onlive (there is a delay caused by the indexation)

share|improve this answer

If they are within the same site collection, you could use a Content Query web part to aggregate all the data or use a tool like the Lightning Conductor web part from Lightning Tools.

share|improve this answer
The Lightning Conductor web part goes beyond the site collection barrier and will allow you to get data from several site collections at once. Thought I should clarify that. – Eric Alexander Dec 14 '10 at 13:40

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.