【问题标题】:SSIS precedence constraint - expression with ANDSSIS 优先约束 - 带有 AND 的表达式
【发布时间】:2021-01-20 17:28:50
【问题描述】:

我正在使用 Visual Studio 2019 和 SQL Server SSIS。

在优先约束中,如何在表达式中使用AND

例如,如果我有:

@myVariable1 == 0 AND @myVariable2 == 0

我收到消息

表达式无法计算

这就是我想要达到的目标:

我知道双管道运算符是一个逻辑ORAND 有类似的东西吗?

【问题讨论】:

    标签: sql sql-server ssis


    【解决方案1】:

    你需要像这样使用&&

    @myVariable1 == 0 && @myVariable2 == 0
    

    这里是 SSIS 表达式运算符的完整列表:

    Operator Description
    Cast Converts an expression from one data type to a different data type.
    () (Parentheses) Identifies the evaluation order of expressions.
    + (Add) (SSIS) Adds two numeric expressions.
    + (Concatenate) Concatenates two expressions.
    - (Subtract) Subtracts the second numeric expression from the first one.
    - (Negate) Negates a numeric expression.
    * (Multiply) Multiplies two numeric expressions.
    / (Divide) Divides the first numeric expression by the second one.
    % (Modulo) Provides the integer remainder after dividing the first numeric expression by the second one.
    || (Logical OR) Performs a logical OR operation.
    && (Logical AND) Performs a logical AND operation.
    ! (Logical NOT) Negates a Boolean operand.
    | (Bitwise Inclusive OR) Performs a bitwise OR operation of two integer values.
    ^ (Bitwise Exclusive OR) Performs a bitwise exclusive OR operation of two integer values.
    & (Bitwise AND) Performs a bitwise AND operation of two integer values.
    ~ (Bitwise NOT) Performs a bitwise negation of an integer.
    == (Equal) Performs a comparison to determine if two expressions are equal.
    != (Unequal) Performs a comparison to determine if two expressions are not equal.
    > (Greater Than) Performs a comparison to determine if the first expression is greater than the second one.
    < (Less Than) Performs a comparison to determine if the first expression is less than the second one.
    >= (Greater Than or Equal To) Performs a comparison to determine if the first expression is greater than or equal to the second one.
    <= (Less Than or Equal To) Performs a comparison to determine if the first expression is less than or equal to the second one.
    ? : (Conditional) Returns one of two expressions based on the evaluation of a Boolean expression.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-12
      • 1970-01-01
      • 2020-03-13
      相关资源
      最近更新 更多