• Greetings,

    Not sure if you are asking for putting a CASE inside a stored procedure or if you want a single SELECT to use the CASE statement. It sounds like you already have 3 different SELECT statements to return your values and just want to have a flag turned on if any of them return a result. If so, then maybe this will help you.

    DECLARE @CheckFlag tinyint

    SET @CheckFlag = 0

    IF EXISTS(SELECT * FROM MyTable WHERE Checks1 = true)

    BEGIN

    SET @ChecksFlag = 1

    END

    IF EXISTS(SELECT * FROM MyTable WHERE Checks2 = true)

    BEGIN

    SET @ChecksFlag = 1

    END

    IF EXISTS(SELECT * FROM MyTable WHERE Checks3 = true)

    BEGIN

    SET @ChecksFlag = 1

    END

    RETURN(@ChecksFlag) -- OR Just use it from the procedure.