Count of packages within each folder

Just for KimĀ  O. And Sherry K., this query will provide a count of packages within each package folder.

SELECT
vSMS_Folders.Name,
Count(vSMS_Folders.ContainerNodeID) as ‘Count’
FROM
dbo.v_Package v_Package,
dbo.vFolderMembers vFolderMembers,
dbo.vSMS_Folders vSMS_Folders
WHERE
v_Package.PackageID = vFolderMembers.InstanceKey
AND vSMS_Folders.ContainerNodeID = vFolderMembers.ContainerNodeID
AND vSMS_Folders.ObjectType=2
Group by
vSMS_Folders.Name
Order by
vSMS_Folders.Name

Leave a Reply

Your email address will not be published. Required fields are marked *