|| (Logical OR) (SSIS Expression)

 

Applies To: SQL Server 2016

Performs a logical OR operation. The expression evaluates to TRUE if one or both conditions are TRUE.

  
boolean_expression1 || boolean_expression2  

boolean_expression1, boolean_expression2
Is any valid expression that evaluates to TRUE, FALSE, or NULL.

DT_BOOL

The following table shows the result of the || operator.

ResultExpressionExpression
TRUETRUETRUE
TRUETRUEFALSE
FALSEFALSEFALSE
NULLNULLNULL
TRUENULLTRUE
NULLNULLFALSE

This example uses the StandardCost and ListPrice columns. The example evaluates to TRUE if the value of the StandardCost column is less than 300 or the ListPrice column is greater than 500.

StandardCost < 300 || ListPrice > 500  

This example uses the variables SPrice and LPrice instead of numeric literals.

StandardCost < @SPrice || ListPrice > @LPrice  

| (Bitwise Inclusive OR) (SSIS Expression)
^ (Bitwise Exclusive OR) (SSIS Expression)
Operator Precedence and Associativity
Operators (SSIS Expression)

Community Additions

ADD
Show: