TechNet
Export (0) Print
Expand All

! (Logical Not) (SSIS Expression)

 

Applies To: SQL Server 2016

Negates a Boolean operand.

System_CAPS_ICON_note.jpg Note


The ! operator cannot be used in conjunction with other operators. For example, you cannot combine the ! and the > operators into the !>. operator.

  
!boolean_expression  
  

boolean_expression
Is any valid expression that evaluates to a Boolean. For more information, see Integration Services Data Types.

DT_BOOL

The following table shows the result of the ! operation.

Original Boolean expressionAfter applying the ! operator
TRUEFALSE
NULLNULL
FALSETRUE

This example evaluates to FALSE if the Color column value is "red".

!(Color == "red")  

This example evaluates to TRUE if the value of the MonthNumber variable is the same as the integer that represents the current month. For more information, see MONTH (SSIS Expression) and GETDATE (SSIS Expression).

!(@MonthNumber != MONTH(GETDATE())  

Operator Precedence and Associativity
Operators (SSIS Expression)

Community Additions

ADD
Show:
© 2016 Microsoft