^ (Bitwise XOR) (TSQL Operator)
Returns the bitwise XOR 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 11010000 (208)
PRINT 143 ^ 95;
The result is:
208