Skip to content

Instantly share code, notes, and snippets.

@CodyMathis123
Created August 15, 2019 16:59
Show Gist options
  • Save CodyMathis123/87c14bf0c2ee090dc48d6b4a03021923 to your computer and use it in GitHub Desktop.
Save CodyMathis123/87c14bf0c2ee090dc48d6b4a03021923 to your computer and use it in GitHub Desktop.
/*
This query will show you the count of records per Hardware Inventory class in your HinvChangeLog table.
This can help you identify a class that is create a lot of hardware inventory 'traffic' and potentially bloating
your database.
*/
SELECT map.DisplayName
, map.InvClassName AS 'Inventory View'
, COUNT(HINV.RecordID)
FROM HinvChangeLog hinv
LEFT JOIN v_GroupMap map ON map.GroupID = hinv.GroupKey
GROUP BY map.DisplayName
, map.InvClassName
ORDER BY 3 DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment