Posted by Eswar Koneti on August 1st, 2012
If you are performing SCCM cleanup activity on packages,this might help you to identify if there are any packages still available on DPs rather looking at each package manually also to check how many DP’s each package available so you can distribute the package to missing DP’s(if you have standards to ensure all packages should be on X many DP’s)
SELECT PackageID, Name, Version, Manufacturer, Language, Description,PkgSourcePath , LastRefreshTime,
(SELECT COUNT(PkgID) FROM vPkgStatusSummaryDistPts WHERE PkgID = v_Package.PackageID) AS [Total Number of DP’s]
order by [Total Number of DP’s] desc
P.S :Quotes in this post are fancy quotes,please replace them in your query while pasting.