Hi,
im used to oracle and i need the same with sql-server:
select case bin_to_num(flag3, flag2, flag1)
when 0 then 'no flag is set'
when 1 then 'flag1 is set'
when 2 then 'flag2 is set'
when 3 then 'flag1 and flag2 is set'
when 4 then 'flag3 is set'
when 5 then 'flag1 and flag3 is set'
when 6 then 'flag2 and flag3 is set'
when 7 then 'flag1 and flag2 and flag3 is set'
else 'error'
end result
from (select 1 flag1, 0 flag2, 1 flag3 from table)
is there any function equal to bin_to_num?
Thanks in advance
im used to oracle and i need the same with sql-server:
select case bin_to_num(flag3, flag2, flag1)
when 0 then 'no flag is set'
when 1 then 'flag1 is set'
when 2 then 'flag2 is set'
when 3 then 'flag1 and flag2 is set'
when 4 then 'flag3 is set'
when 5 then 'flag1 and flag3 is set'
when 6 then 'flag2 and flag3 is set'
when 7 then 'flag1 and flag2 and flag3 is set'
else 'error'
end result
from (select 1 flag1, 0 flag2, 1 flag3 from table)
is there any function equal to bin_to_num?
Thanks in advance