Skip to content

Instantly share code, notes, and snippets.

@DarkAllien
Last active March 4, 2016 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarkAllien/5bf3900fc6900f05948a to your computer and use it in GitHub Desktop.
Save DarkAllien/5bf3900fc6900f05948a to your computer and use it in GitHub Desktop.
query - software updates - to be applied
declare @AuthListLocalID as int
select @AuthListLocalID=CI_ID from v_AuthListInfo
where CI_UniqueID=@AuthListID
SELECT distinct
ui.BulletinID,
ui.ArticleID,
ui.Title,
ui.Description,
ui.DateRevised,
CASE ui.Severity
WHEN 10 THEN 'Critical'
WHEN 8 THEN 'Important'
WHEN 6 THEN 'Moderate'
WHEN 2 THEN 'Low'
Else '(Unknown)'
END AS [Severity]
into #temp
FROM v_UpdateComplianceStatus ucsa
INNER JOIN v_CIRelation cir ON ucsa.CI_ID = cir.ToCIID
INNER JOIN v_UpdateInfo ui ON ucsa.CI_ID = ui.CI_ID
WHERE
cir.FromCIID=@AuthListLocalID
AND
cir.RelationType=1
AND
ucsa.Status = '2' --Required
select distinct
bulletinid,articleid,title,description,daterevised,severity,ROW_NUMBER( ) over (order by severity,bulletinid) as [row]
from #temp order by row
drop table #temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment