~ (Bitwise Not) (SSIS Expression)

 

Applies To: SQL Server 2016

Performs a bitwise negation of an integer. This operator can be applied to signed and unsigned integer data types.

  
~integer_expression  
  

integer_expression
Is any valid expression of an integer data type. integer_expression is an integer that is transformed into a binary number for the bitwise operation. For more information, see Integration Services Data Types.

Returns the data type of integer_expression.

None

This example performs a bitwise ~ (NOT) operation on the number 170 (0000 0000 1010 1010). The number is a signed integer.

  
~ 170  

The expression evaluates to -170 (1111111101010101).

0000000010101010

----------------------

1111111101010101

Operator Precedence and Associativity
Operators (SSIS Expression)

Community Additions

ADD
Show: