Skip to content

Instantly share code, notes, and snippets.

@Laim
Created May 26, 2021 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laim/72d6755a3d215bbc31c44bf1d3e95900 to your computer and use it in GitHub Desktop.
Save Laim/72d6755a3d215bbc31c44bf1d3e95900 to your computer and use it in GitHub Desktop.
-- Custom Fields
SELECT C.Name, COUNT(CF.CID) AS [CustomFieldCount] FROM SnowLicenseManager.dbo.tblCustomField CF
INNER JOIN SnowLicenseManager.dbo.tblCID C ON CF.CID = C.CID
GROUP BY C.Name
-- Custom Compare Values
SELECT C.Name, COUNT(CCV.CID) AS [CCVCount] FROM SnowLicenseManager.dbo.tblCustomCompareValues CCV
INNER JOIN SnowLicenseManager.dbo.tblCID C ON CCV.CID = C.CID
GROUP BY C.Name
-- Blacklist
SELECT C.Name, COUNT(B.CID) AS [BlacklistCount] FROM SnowLicenseManager.dbo.tblApplicationBlacklistDefinition B
INNER JOIN SnowLicenseManager.dbo.tblCID C ON B.CID = C.CID
GROUP BY C.Name
-- Whitelist
SELECT C.Name, COUNT(W.CID) AS [WhitelistCount] FROM SnowLicenseManager.dbo.tblApplicationWhitelistDefinition W
INNER JOIN SnowLicenseManager.dbo.tblCID C ON W.CID = C.CID
GROUP BY C.Name
-- Computer Standards
SELECT C.Name, COUNT(CS.CID) AS [ComputerStdCount] FROM SnowLicenseManager.dbo.tblComputerStandard CS
INNER JOIN SnowLicenseManager.dbo.tblCID C ON CS.CID = C.CID
GROUP BY C.Name
-- License Policy
SELECT C.Name, COUNT (LP.CID) AS [LicensePolicyCount] FROM SnowLicenseManager.dbo.tblLicensePolicies LP
INNER JOIN SnowLicenseManager.dbo.tblCID C ON LP.CID = C.CID
GROUP BY C.Name
-- Web Applications
SELECT C.Name, COUNT (WAP.CID) AS [WAPCount] FROM SnowLicenseManager.dbo.tblWebApplicationPatterns WAP
INNER JOIN SnowLicenseManager.dbo.tblCID C ON WAP.CID = C.CID
GROUP BY C.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment