There are a gazillion informative blog articles already out there regarding U2U’s CAML Query Builder tool.  However, there are also a billion useless links and navigation rabbit holes to versions of the tool that will not install in a SharePoint 2010 environment.  What you need for that is the standalone client tool that will allow you to connect to a 2010 SharePoint site via the Web Services.

My favorite things about this tool:

  • Result tab gives an exhaustive view into what properties/fields are available to you
  • Query construction tab lets you construct your CAML query with no experience necessary
  • I’ve heard that you can just zip up the Program Files directory after this tool is installed and carry that around from environment to environment. I have placed a zipped copy on my usb stick should the need to test this capability arise.

 

Possible gotchas:

  • Don’t copy the <Query> nodes into your SPQuery.Query string object!  Won’t work
    image
  • If you are generating a query for SPSiteDataQuery, replace those single quotes with double quotes
    image
  • I haven’t had any success connecting with the Object Model, but the Web Services work great!
    image