Bitwise OR (|) Truth Table
| 0 1
0 0 1
1 1 1
Combining Multiple Flags Using the Bitwise OR Operator, Behind the Scenes
00000001 -- 1
|
00000010 -- 2
|
00000100 -- 4
|
00001000 -- 8
--------
00001111 -- 1+2+4+8 = 15
Combining Multiple Flags Using the Bitwise OR Operator, in T-SQL
19> SELECT
20> 1 | 2 | 4 | 8
21> GO
-----------
15
(1 rows affected)