--I'm not having that problem:set nocount ondeclare @tb table (flag bit)insert @tbselect null union allselect 1 union allselect 1 union allselect 0 union allselect nullselect max( convert(tinyint, flag) ) from @tb
as another wacky idea you could store single tinyint column to hold all combinationsNoPrivs = 0canView = 1canDelete = 2canUpdate = 4canCreate = 8declare @priv tinyintselect @priv = 1 | 2 | 8Select @priv [@priv]Select CanView = case when @priv & 1 = 1 then 1 else 0 end ,CanDelete = case when @priv & 2 = 2 then 1 else 0 end ,CanUpdate = case when @priv & 4 = 4 then 1 else 0 end ,CanCreate = case when @priv & 8 = 8 then 1 else 0 end
Be One with the OptimizerTG