Following the logic in a previous post, File Extension, this query will list Ektron asset file extensions and count them.
SELECT (
CASE
WHEN handle LIKE '%.%'
THEN reverse(left(reverse(handle), charindex('.', reverse(handle)) - 1))
ELSE ''
END
) AS FilePath
,COUNT(*) AS 'Total Assets'
FROM AssetDataTable
GROUP BY (
CASE
WHEN handle LIKE '%.%'
THEN reverse(left(reverse(handle), charindex('.', reverse(handle)) - 1))
ELSE ''
END
)
ORDER BY FilePath
SELECT (
CASE
WHEN handle LIKE '%.%'
THEN reverse(left(reverse(handle), charindex('.', reverse(handle)) - 1))
ELSE ''
END
) AS FilePath
,CASE
WHEN [content_status] = 'A'
THEN 'Approved'
WHEN [content_status] = 'O'
THEN 'Checked Out'
WHEN [content_status] = 'I'
THEN 'Checked In'
WHEN [content_status] = 'S'
THEN 'Submitted for Approval'
WHEN [content_status] = 'M'
THEN 'Marked for Deletion'
WHEN [content_status] = 'P'
THEN 'Pending Go Live Date'
WHEN [content_status] = 'T'
THEN 'Awaiting Completion of Associated Tasks'
WHEN [content_status] = 'D'
THEN 'Pending Deletion'
END AS ContentStatus
,COUNT(*) AS 'Total Assets'
FROM AssetDataTable
INNER JOIN content c ON c.asset_id = AssetDataTable.id
GROUP BY (
CASE
WHEN handle LIKE '%.%'
THEN reverse(left(reverse(handle), charindex('.', reverse(handle)) - 1))
ELSE ''
END
)
,[content_status]
ORDER BY FilePath
,ContentStatus
Originally Posted on October 17, 2013
Last Updated on October 26, 2015
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.