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

In SharePoint 2010 SPQuery has the ViewFieldsOnly property that apparently optimises the query by only returning the data you specifically ask for.

Unfortunately the 2007 version of SPQuery doesn't have this property. Does this mean the query acts as though ViewFieldsOnly is set to true, or is it effectively false?

share|improve this question
up vote 4 down vote accepted

Regardless of the Fields listed in the ViewFields, SPQuery has always returned extra fields including ID, and a few other system related fields as well as auto-retrieving linked fields for computed columns etc. The ViewFieldsOnly allows you to really only return the exact fields specified. The downside is that the returned item may no longer be updateable without those key fields.

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.