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 )