SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

I'm using SPSiteDataQuery class to query pages for particular content type and tag across the site collection. The custom content type is inherited from Page content type and contains 'Summary' field of HTML type.

The problem is that some rows in the query results have empty summaries ​​in spite of the fact that summary field is required and values are specified for all list items. The weird thing that if I remove tag filtering from query then summaries for all items are returned by SPSiteDataQuery.

Field declaration:

<Field ID="{76F58F2C-8574-48DB-B539-7EC26BDB46F5}"
       RichTextMode="FullHtml" />


      <FieldRef Name=ContentTypeId' />
      <Value Type='Text'>0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900fbd29e8cfdd742e9bb524da6f26152ad<Value>
      <FieldRef Name='TaxKeyword' LookupId='TRUE'/>
        <Value Type='Counter'>20</Value>


SPSiteDataQuery query = new SPSiteDataQuery();
query.ViewFields = "<FieldRef Name='Title' Type='Text'/><FieldRef Name='ArticleSummary' Type='HTML'/>";
query.Lists = "<Lists ServerTemplate='850' />";
query.RowLimit = 100;
query.Webs = "<Webs Scope='SiteCollection' />";
query.Query = "...see above...";

DataTable results = web.GetSiteData(query);
share|improve this question

What you need is basically to point in the ViewFields of the Query that you field could be Nullable at times by using <FieldRef Name='{0}' Type='{1}' Nullable='TRUE'/> replace {0} with field name and {1} could be TEXT or NOTE.

share|improve this answer

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.