, - . , , . , .. MSDB. , SQL, , , . proc , - TSQL .
& (Bitwise AND) (Transact-SQL)
~ (Bitwise NOT) (Transact-SQL)
| (Bitwise OR) (Transact-SQL)
^ (Bitwise Exclusive OR) (Transact-SQL)
E = (A B) (C D)
Select @E=(@A & @B) | (@C & @D)
, -.
declare @E bit
declare @Bit1 bit
declare @Bit2 bit
declare @Bit3 bit
declare @Bit4 bit
declare @Bit5 bit
SET @Bit1 = 1
SET @Bit2 = 0
SET @Bit3 = 1
SET @Bit4 = 'fALSE'
SET @Bit5 = 0
SELECT @Bit1, @Bit2, @Bit3, @Bit4, @Bit5
SELECT @Bit1 & @Bit2
Select @E=(@Bit1 & @Bit2) | (@Bit3 & @Bit4)
Select @E as [E value]