If you put in the Name for Software Update Group and the Collection ID the Main query works I need help getting the parameter to work. Thanks!
Main Query:
declare @SUG VARCHAR(50);
declare @COLID VARCHAR(8);
declare @CI_IDint;select@CI_ID= CI_ID
from CI_ConfigurationItems
whereCIType_ID=9and CI_UniqueID=(select CI_UniqueID asAuthListIDfrom v_AuthListInfo
WhereTitle=@SUG)selectStatus=sn.StateName,StatusNumber=(CASE WHEN StateName='Compliant' THEN 1 WHEN StateName='Non-Compliant' THEN 3 ELSE 2END), cs.NumberOfComputers,PercentOfComputers=convert(float, isnull(cs.NumberOfComputers,0)*100.00)/ isnull(nullif(cs.NumTotal,0),1)from(select CI_ID,NumTotal,[0]=NumUnknown,[1]=NumPresent+NumNotApplicable,[2]=NumMissingfrom v_UpdateSummaryPerCollection
where CI_ID=@CI_IDandCollectionID=@COLID) cnt
unpivot (NumberOfComputersfor[Status]in([0],[1],[2])) cs
left join v_StateNames sn on sn.TopicType=300and sn.StateID=cs.Statuswhere cs.NumberOfComputers>0
order byStatusNumber
Query for SUG Paramter:
SELECT CI_UniqueID,Title
FROM v_AuthListInfo
WHERE Title LIKE '%Compliance%' OR Title LIKE '%Software Updates%'
ORDER BY Title
Query for COLID Parameter:
SELECT DISTINCT c.CollectionID,
c.CollectionName
FROM v_UpdateSummaryPerCollection c
WHERE (CollectionName LIKE '%Patching Group%' OR
c.CollectionName LIKE '%Compliance%' OR
c.CollectionName LIKE '%Server Patching%' OR
c.CollectionName LIKE '%Approved Patching%')
ORDER BY c.CollectionName
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
If you put in the Name for Software Update Group and the Collection ID the Main query works I need help getting the parameter to work. Thanks!
Main Query:
Query for SUG Paramter:
Query for COLID Parameter:
Share this post
Link to post
Share on other sites