Skip to main content

SQL to Find Umbraco v8 Nodes using a Certain Umbraco Document Type

A few years ago, I created this blog post to show how to find Umbraco v7 Nodes using a certain Umbraco Document Type.  

I needed the same thing for Umbraco v8 projects, and below are some scripts that should help with this question.

Find content pages that use a specific document type: 

SELECT * FROM umbracoContent C

INNER JOIN cmsContentType CT ON C.contentTypeId = CT.nodeId

INNER JOIN umbracoNode N ON C.nodeId = N.id

WHERE CT.alias = 'YourDocumentTypeAlias'


Find the latest published version of a content page by content page node id:  

SELECT pt.alias, pd.* FROM umbracoPropertyData as pd

INNER JOIN cmsPropertyType as pt ON pd.propertyTypeiD = pt.id

INNER JOIN umbracoContentVersion as cv ON pd.versionId = cv.id

WHERE cv.NodeId = 1055 and cv.[current] = 1

Comments