Friday 20 November 2009

SPSiteDataQuery error – too many lists in the query

"The query cannot be completed because the number of lists in the query exceeded the allowable limit"


SPSiteDataQuery.Lists has a “MaxListLimit” parameter where you can specify the number of lists that the specified query should go through.

Queries without MaxListLimit parameter will run around 1000 lists. Some says this is upto 1000, but I manage to run a query with 1300+ lists.
I think this is depending on the amount of free server resource at that given time.

Inorder to overcome this limit, we can set the “MaxListLimit='0'”, and that will search all list in the site collection.

SPSiteDataQuery.Lists = < Lists BaseType='1' MaxListLimit='0'>


Larger site collections will demand more server resources.
We are currently running a virtual machine with 3GB ram and it seems don’t have any issue with 2000+ document libraries and several thousands of documents.

No comments:

Post a Comment