DECLARE @a integer
DECLARE @health integer
select @a = COUNT(*) from DB
where prid = 'com'
and (severity = 'minor'
or severity = 'major'
or severity = 'critical')
if @a = 0
BEGIN
SELECT @health = 100
END
if @a > 0
BEGIN
SELECT @health = 70
END
select @health as Health
DECLARE @health integer
select @a = COUNT(*) from DB
where prid = 'com'
and (severity = 'minor'
or severity = 'major'
or severity = 'critical')
if @a = 0
BEGIN
SELECT @health = 100
END
if @a > 0
BEGIN
SELECT @health = 70
END
select @health as Health