Viewing and Querying by Item Path in Sitecore SQL Databases
September 3, 2016
Developing or debugging Sitecore applications can quite often lead
to executing SQL queries to try and work out how something works or
where the issue lies.
One piece of information that cannot be easily accessed in an
SQL query is the hierarchy of items because the item path isn't saved
as a field value within the database. Item hierarchy is instead stored
by each row in the Items table storing the ID of its parent
in the ParentID column.
Running the following SQL statement will create a
view which is a copy of the Items table but with an additional
column defining the item's full path:
Running the query below will return the following result:
Once the view is created, queries can be run like the