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?

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.