declare @a bit ,@b bit select @a = 0 ,@b = -1 select result = 'Exactly one is null? ' + case coalesce(abs(sign(@a)),-1) * coalesce(abs(sign(@b)),-1) when -1 then 'TRUE' else 'FALSE' end