| (Bitwise OR) (TSQL Operator)

Returns the bitwise OR value of two integers.

Syntax

expression | expression

Arguments

expression
is a numeric expression of type bit, tinyint, smallint, int, bigint.

Return Types

Returns the datatype of the expression with the highest type precedence.

Examples

-- binary representation of 143 is        10001111
-- binary representation of  95 is        01011111
-- binary representation of 143 | 95 is   11011111 (223)

PRINT 143 | 95;

The result is:

223