SCCM SQL Query–Patch Supersedence Report

I wanted a way to input a patch KB article and find out if the patch superseded another patch or was superseded by another.  For parameters I used the ArticleID field aka the KBNumber.

select        cir.FromCIID [New CI],
            info.BulletinID [New BulletinID],
            info.ArticleID [New ArticleID],
            info.Title [New Title],
            info.InfoURL [New InfoURL],
            info.DatePosted [New DatePosted],
            cir.ToCIID [SUPERSEDED CI],
            info2.BulletinID [Superseded BulletinID],
            info2.ArticleID [Superseded ArticleID],
            info2.Title [Superseded Title],
            info2.InfoURL [Superseded InfoURL],
            info2.DatePosted [Superseded DatePosted]
           
from v_CIRelation cir
           
left join v_UpdateInfo info on cir.FromCIID = info.CI_ID
left join v_UpdateInfo info2 on cir.ToCIID = info2.CI_ID

           
where RelationType = 6

((info.ArticleID = @KBNumber) OR (info2.ArticleID = @KBNumber))

order by info.BulletinID, info.ArticleID

Published Wednesday, June 01, 2011 8:24 PM by caseyrobertson
Filed under: , ,

Comments

No Comments