Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top