EPiServer CMS 11 Useful SQL Queries - 2
Here is a set of few queries that we have been using in different investigations
Get usages of EPiServer contents including pages and blocksCheck Table sizeNo contents have been added for following content typesLooking into Activity LogsUnmapped Property List
Get usages of EPiServer contents including pages and blocks
SELECT
tct.Name,
tct.ModelType,
COUNT(tc.pkID) AS PageCount
FROM
tblContent AS tc RIGHT OUTER JOIN
tblContentType AS tct ON tc.fkContentTypeID = tct.pkID
Where tct.ModelType is not null and tct.ModelType not like 'EPiServer.%'
GROUP BY
tct.Name, tct.ModelType
ORDER BY
PageCount desc
Check table size
EXEC sp_spaceused 'tblBigTable'
No contents have been added for following content types
SELECT
tct.Name,
tct.ModelType
FROM
tblContent AS tc RIGHT OUTER JOIN
tblContentType AS tct ON tc.fkContentTypeID = tct.pkID
Where tct.ModelType is not null and tct.ModelType not like 'EPiServer.%'
GROUP BY
tct.Name, tct.ModelType
Having COUNT(tc.pkID) = 0
Looking int…
Get usages of EPiServer contents including pages and blocksCheck Table sizeNo contents have been added for following content typesLooking into Activity LogsUnmapped Property List
Get usages of EPiServer contents including pages and blocks
SELECT
tct.Name,
tct.ModelType,
COUNT(tc.pkID) AS PageCount
FROM
tblContent AS tc RIGHT OUTER JOIN
tblContentType AS tct ON tc.fkContentTypeID = tct.pkID
Where tct.ModelType is not null and tct.ModelType not like 'EPiServer.%'
GROUP BY
tct.Name, tct.ModelType
ORDER BY
PageCount desc
Check table size
EXEC sp_spaceused 'tblBigTable'
No contents have been added for following content types
SELECT
tct.Name,
tct.ModelType
FROM
tblContent AS tc RIGHT OUTER JOIN
tblContentType AS tct ON tc.fkContentTypeID = tct.pkID
Where tct.ModelType is not null and tct.ModelType not like 'EPiServer.%'
GROUP BY
tct.Name, tct.ModelType
Having COUNT(tc.pkID) = 0
Looking int…