||(逻辑或)(SSIS 表达式)

适用范围:SQL ServerAzure 数据工厂中的 SSIS Integration Runtime

执行逻辑或运算。 如果条件之一或两个条件都为 TRUE,则表达式计算结果为 TRUE。

语法

  
boolean_expression1 || boolean_expression2  

参数

boolean_expression1、boolean_expression2
计算结果为 TRUE、FALSE 或 NULL 的任意有效表达式。

结果类型

DT_BOOL

注解

下表显示了 || 运算符的结果。

结果 表达式 表达式
TRUE TRUE TRUE
TRUE TRUE FALSE
FALSE FALSE FALSE
Null Null Null
TRUE Null TRUE
Null Null FALSE

SSIS 表达式示例

该示例使用 StandardCost 和 ListPrice 列。 如果 StandardCost 列的值小于 300 或者 ListPrice 列的值大于 500,则该示例计算结果为 TRUE。

StandardCost < 300 || ListPrice > 500  

该示例使用变量 SPrice 和 LPrice ,而不是数值。

StandardCost < @SPrice || ListPrice > @LPrice