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_ID int;
select @CI_ID = CI_ID
from CI_ConfigurationItems
where CIType_ID=9 and CI_UniqueID=(select CI_UniqueID as AuthListID from v_AuthListInfo
Where Title=@SUG)
select Status=sn.StateName, StatusNumber=(CASE WHEN StateName='Compliant' THEN 1 WHEN StateName='Non-Compliant' THEN 3 ELSE 2 END), 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]=NumMissing
from v_UpdateSummaryPerCollection
where CI_ID=@CI_ID and CollectionID=@COLID
) cnt
unpivot (NumberOfComputers for [Status] in ([0], [1], [2])) cs
left join v_StateNames sn on sn.TopicType=300 and sn.StateID=cs.Status
where cs.NumberOfComputers>0
order by StatusNumber
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