Thursday, October 29, 2009

Comparision between SPQuery and SPSiteDataQuery objects in WSS 3.0

SPQuery

* Used to query set of items within a particular list
* Significantly faster to fetch items out of a list compared to SP object model.
* Takes CAML query as input to the query property and returns SPListItemCollection

SPSiteDataQuery

* Used to query set of items from many different lists through the entire site collection
* Queries run through SPSiteDataQuery object are sometimes known as cross-site queries.
* Takes CAML query as input to the query property and returns ADO.NET DataTable object
* Scope of the query is controlled in CAML query using Webs property of the object.

Hope this helps!!!

No comments:

Post a Comment