Incompatible data types

  • Hi,

    I have a SSIS package where it pulls data from an excel source .

    One of the column is SLA. The source is DT_R8 . The destination table (dest_SLA is int)

    WHEN I try to use a conditional Split for incremental updates

    (ISNULL( [Copy of SLA] ) ? "" : ( [Copy of SLA] ) ) != (ISNULL(Service_SLA_LKP) ? "" : (Service_SLA_LKP))

    it fails with the error code below

    TITLE: Microsoft Visual Studio

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

    Error at pops_Service [Conditional Split [387]]: The data types "DT_WSTR" and "DT_R8" are incompatible for the conditional operator. The operand types cannot be implicitly cast into compatible types for the conditional operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

    Error at pops_Service [Conditional Split [387]]: Attempt to set the result type of conditional operation "ISNULL(SLA) ? "" : (SLA)" failed with error code 0xC004709F.

    Error at pops_Service [Conditional Split [387]]: Computing the expression "(ISNULL( [SLA] ) ? "" : ( [SLA] ) ) != (ISNULL(Service_SLA_LKP) ? "" : (Service_SLA_LKP))" failed with error code 0xC00470A0. The expression may have errors, such as divide by zero, that cannot be detected at parse time, or there may be an out-of-memory error.

    Error at pops_Service [Conditional Split [387]]: The expression "(ISNULL( [SLA] ) ? "" : ( [SLA] ) ) != (ISNULL(Service_SLA_LKP) ? "" : (Service_SLA_LKP))" on "output "Case 3" (1841)" is not valid.

    Error at pops_Service [Conditional Split [387]]: Failed to set property "Expression" on "output "Case 3" (1841)".

    I tried to change the data type in the excel source to DT_WSTR but still getting the same error.

    Please help.

  • You can't change the data type to DT_WSTR directly in the excel source. Better to use Data Type Conversion transformation to transform input into DT_WSTR, which are not supported by your destination type.

    __________________________________________
    ---------------------------------------------------
    Save our mother Earth. Go Green !!!

  • The problem is that you are using numbers in your expression, but as result you give in some branches the empty string.

    Strings and numbers aren't compatible, so either use NULL or a dummy integer value.

    By the way, are you sure you are using a conditional split? The expression you wrote is for a derived column, not for a conditional split. This last one needs a Boolean expression.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply