^ (Bitwise Exclusive OR) (SSIS)
Performs a bitwise exclusive OR operation of two integer values. It compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. If both bits are 0 or both bits are 1, the corresponding result bit is set to 0.
Both conditions must be a signed integer data type or both conditions must be an unsigned integer data type.
- integer_expression1, integer_expression2
Is any valid expression of a signed or unsigned integer data type. For more information, see Integration Services Data Types.
Determined by data types of the two arguments. For more information, see Data Type Conversion in Expressions.
This example performs a bitwise exclusive OR operation between variables NumberA and NumberB. NumberA contains 3 (00000011) and NumberB contains 7 (00000111).
@NumberA ^ @NumberB
The expression evaluates to 4 (00000100).
This example performs a bitwise exclusive OR operation between the ReorderPoint and SafetyStockLevel columns.
ReorderPoint ^ SafetyStockLevel
If ReorderPoint is 10 and SafetyStockLevel is 8, the expression evaluates to 2 (00000010).
This example performs a bitwise exclusive OR operation between two integers.
3 ^ 5
The expression evaluates to 6 (00000110).