Skip to content

Instantly share code, notes, and snippets.

@asontu
Last active May 9, 2022 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asontu/0feb1c592a42dd0cea34bbf0c9eee806 to your computer and use it in GitHub Desktop.
Save asontu/0feb1c592a42dd0cea34bbf0c9eee806 to your computer and use it in GitHub Desktop.
;with RootItems as (
select cast(rt.ID as uniqueidentifier) ID, cast(rt.Path as nvarchar(max)) Path
from (select ''n)t
cross apply ( values
('{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}', '/sitecore/content'),
('{B701850A-CB8A-4943-B2BC-DDDB1238C103}', '/sitecore/Forms'),
('{3D6658D8-A0BF-4E75-B3E2-D050FABCF4E1}', '/sitecore/media library'),
('{B26BD035-8D0A-4DF3-8F67-2DE3C7FDD74A}', '/sitecore/templates/Foundation'),
('{8F343079-3CC5-4EF7-BC27-32ADDB46F45E}', '/sitecore/templates/Feature'),
('{825B30B4-B40B-422E-9920-23A1B6BDA89C}', '/sitecore/templates/Project'),
('{B29EE504-861C-492F-95A3-0D890B6FCA09}', '/sitecore/templates/User Defined'),
('{E24C4A00-08D6-41C8-B60E-E7990B21697A}', '/sitecore/templates/Branches/Foundation'),
('{AD71FACC-3C23-4DF8-A427-672020DB5612}', '/sitecore/templates/Branches/Feature'),
('{A1F6469D-16E1-4A5F-9E49-1AAD869A5D11}', '/sitecore/templates/Branches/Project'),
('{F03DED1F-B02B-49A1-B4C0-793C6F092CFD}', '/sitecore/templates/Branches/User Defined')
) rt(ID,path)
), ItemPaths as (
select r.ID, r.Path
from RootItems r
union all
select i.ID, p.Path + '/' + i.Name
from ItemPaths p
join dbo.Items i on i.ParentID = p.ID
)
select top 10 *
from ItemPaths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment