Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Content Audit

Posted on July 19, 2013October 26, 2015 By David Kittell
SELECT COUNT(*) AS "# Of Templates"
FROM templates_tbl
SELECT DISTINCT template_id AS "Template ID"
	,count(*) AS "Usage"
FROM content
GROUP BY template_id
ORDER BY "Template ID"
SELECT [content].content_id
	,[content].content_title
	,templates_tbl.template_filename
FROM [content]
INNER JOIN templates_tbl ON [content].template_id = templates_tbl.template_id
WHERE templates_tbl.template_filename LIKE '%templates%'
ORDER BY templates_tbl.template_filename
	,[content].content_id
	,[content].content_title

SELECT count(*) AS "Total Content Items"
FROM content
SELECT CASE content_type
		WHEN - 1
			THEN CAST(content_type AS VARCHAR(5)) + ' - AllTypes'
		WHEN 1
			THEN CAST(content_type AS VARCHAR(5)) + ' - Content'
		WHEN 2
			THEN CAST(content_type AS VARCHAR(5)) + ' - Forms'
		WHEN 3
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Content'
		WHEN 4
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Forms'
		WHEN 7
			THEN CAST(content_type AS VARCHAR(5)) + ' - Library Item'
		WHEN 8
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 9
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Assets'
		WHEN 12
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Media'
		WHEN 99
			THEN CAST(content_type AS VARCHAR(5)) + ' - Non Library Content'
		WHEN 101
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 102
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 103
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 104
			THEN CAST(content_type AS VARCHAR(5)) + ' - Multimedia'
		WHEN 1111
			THEN CAST(content_type AS VARCHAR(5)) + ' - Discussion Topic'
		WHEN 3333
			THEN CAST(content_type AS VARCHAR(5)) + ' - Catalog Entry'
		END AS 'Content Type'
	,COUNT(*) AS 'Total Content Written'
FROM content c
GROUP BY c.content_type
ORDER BY 'Content Type'
SELECT c.user_id AS 'Content Author ID'
    ,(first_name + ' ' + last_name) AS 'Content Author'
    --,c.content_type AS 'Content Type'
    ,CASE content_type
        WHEN - 1
            THEN CAST(content_type AS VARCHAR(5)) + ' - AllTypes'
        WHEN 1
            THEN CAST(content_type AS VARCHAR(5)) + ' - Content'
        WHEN 2
            THEN CAST(content_type AS VARCHAR(5)) + ' - Forms'
        WHEN 3
            THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Content'
        WHEN 4
            THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Forms'
        WHEN 7
            THEN CAST(content_type AS VARCHAR(5)) + ' - Library Item'
        WHEN 8
            THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
        WHEN 9
            THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Assets'
        WHEN 12
            THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Media'
        WHEN 99
            THEN CAST(content_type AS VARCHAR(5)) + ' - Non Library Content'
        WHEN 101
            THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
        WHEN 102
            THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
        WHEN 103
            THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
        WHEN 104
            THEN CAST(content_type AS VARCHAR(5)) + ' - Multimedia'
        WHEN 1111
            THEN CAST(content_type AS VARCHAR(5)) + ' - Discussion Topic'
        WHEN 3333
            THEN CAST(content_type AS VARCHAR(5)) + ' - Catalog Entry'
        END AS 'Content Type'
    ,COUNT(*) AS 'Total Content Written'
FROM content c
INNER JOIN users u ON u.user_id = c.user_id
GROUP BY c.content_type
    ,c.user_id
    ,u.first_name
    ,u.last_name
ORDER BY 'Content Author'
    ,'Content Author ID'
Originally Posted on July 19, 2013
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.

Related

Code MSSQL - Ektron

Post navigation

Previous post
Next post

Related Posts

Unix – Add User Group To Sudousers

Posted on August 5, 2016

usergroup="developers" su # type in sudo password chmod -v +w /etc/sudoers && echo -e "%$usergroup ALL=(ALL) ALL" >> /etc/sudoers && chmod -v -w /etc/sudoers 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…

Read More

PowerShell – RSS Feed Reader

Posted on December 15, 2015February 12, 2016

clear $rssFeedURL = ‘http://www.kittell.net/feed/’ $rssFeed = 1(New-Object System.Net.WebClient).DownloadString($rssFeedURL) $rssFeed.rss.channel.item | Select-Object title, link -First 5 | Format-Table -AutoSize GitHub: https://gist.github.com/dkittell/ca4025e4e78ccecbb5f0 Originally Posted on December 15, 2015Last Updated on February 12, 2016 All information on this site is shared with the intention to help. Before any source code or program is…

Read More

Select Records Within Date Range

Posted on April 24, 2013October 26, 2015

This query include the start and end date. SELECT * FROM table WHERE datefield BETWEEN ‘<start date>’ AND ‘<end date>’ Originally Posted on April 24, 2013Last Updated on October 26, 2015 All information on this site is shared with the intention to help. Before any source code or program is…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
  • Mac OS X Terminal - Parallels - Reset Windows User Password
  • PowerShell - IPv4 Range

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
  • Mac OS X Terminal - Parallels - Reset Windows User Password
  • PowerShell - IPv4 Range
©2025 David Kittell | WordPress Theme by SuperbThemes