• Does the following code give you any ideas on how to approach this problem?

    declare @BitTest int,

    @BitValue int;

    set @BitTest = 2 + 4 + 8 + 16;

    set @BitValue = 7;

    select case when (@BitTest & @BitValue) = @BitValue then 'true' else 'false' end;

    set @BitTest = 2 + 4 + 8 + 16;

    set @BitValue = 6;

    select case when (@BitTest & @BitValue) = @BitValue then 'true' else 'false' end;