Skip to content

Instantly share code, notes, and snippets.

@bradleykronson
Last active August 29, 2015 14:16
Show Gist options
  • Save bradleykronson/324603a8d65bb427352d to your computer and use it in GitHub Desktop.
Save bradleykronson/324603a8d65bb427352d to your computer and use it in GitHub Desktop.
Get all property values of all items of a particular document type
SELECT n.id AS nodeid ,
n.text ,
pt.Alias ,
pd.dataInt ,
pd.dataDate ,
pd.dataNvarchar ,
pd.dataNtext
FROM cmsPropertyData AS pd
INNER JOIN cmsPropertyType AS pt ON pt.id = pd.propertytypeid
INNER JOIN umbracoNode AS n ON n.id = pd.contentNodeId
WHERE pd.versionId IN (
SELECT d.versionId
FROM cmsContent C
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId
INNER JOIN umbracoNode N ON C.nodeId = N.id
INNER JOIN dbo.cmsDocument d ON C.nodeId = d.nodeId
WHERE CT.alias = 'WG2K_Starter_AppSetting'
AND d.newest = 1 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment