Global Office Directory
More Products
Share this page
Home > Community > Technical Blogs > John West Sitecore Blog > Sitecore Rocks Queries
This blog post provides information about invoking queries with Sitecore Rocks, the Visual Studio extension for developers working with the ASP.NET CMS. Sitecore Rocks Query Analyzer allows you to identify, publish, update (including search and replace), package, serialize, import, delete and otherwise manipulate items from within Visual Studio. For more information about Sitecore Rocks, see my blog post Introducing Sitecore Rocks.
Sitecore Rocks provides a Query Analyzer application that does more than just evaluate Sitecore queries. Query Analyzer uses a scripting syntax based on Sitecore Query, which in turn is based on XPath. For more information about Sitecore Query, see Using Sitecore Query on the Sitecore Developer Network (SDN).
Unlike queries that you can run in the Sitecore CMS, Query Analyzer supports deletes, updates and inserts (all four CRUD functions). As this application actually invokes queries as opposed to analyzing them, the name may change, but like SQL (Structured "Query" language) itself, it might not.
To access Query Analyzer in Visual Studio, in Sitecore Explorer, right-click a database, and then click Query Analyzer. Query Analyzer opens with a default query of "help;"; click Execute to get a list of available commands. Enter "help <command>;" to get information about a specific command. Available commands include:
Another way to open Query Analyzer is to right-click an item (or the header in item editor), then click Tools, then click Scripts, and then click Select, Update, Insert, Delete or Publish. This opens Query Analyzer with a stub query to which you can add, which is a great way to learn the syntax.
There is yet another way to construct a query, specifically for search and replace:
Of course, Sitecore Query does exactly what you tell it to do, which can be dangerous. Use caution around keywords that update items.
Tags: Architecture, Infrastructure
- John West July 15, 2011 at 8:25 AM
- John West May 08, 2012 at 2:21 PM
- John West May 13, 2012 at 8:45 AM
- John West September 21, 2012 at 10:56 AM
- Chris Lewis February 06, 2013 at 1:51 AM
- John West February 06, 2013 at 8:54 AM
- John West February 06, 2013 at 8:55 AM
- John West February 06, 2013 at 10:42 AM
- Chris Lewis February 06, 2013 at 11:55 PM
- Chris Lewis February 27, 2013 at 10:28 AM
- John West February 27, 2013 at 11:14 AM
- Chris Lewis February 28, 2013 at 1:27 AM
John has over ten years of experience in the CMS industry. His areas of focus include the Sitecore community, Web industry research, Sitecore technical documentation, and product management.
This website is designed to be fully functional with scripts disabled in browser. Please contact the webmaster for any suggestions