SSIS comparing NTEXT fields

  • I have a workflow in SSIS where I am using the conditional split transformation. Here is an example of my statement in the condition field:

    ((ISNULL(ENTRYCOMMENT) ? "AAAAA" : ENTRYCOMMENT) != (ISNULL(ENTRYCOMMENT_LKP) ? "AAAAA" : ENTRYCOMMENT_LKP))

    My issue here is this is not a DT_WSTR field, but rather a NTEXT field.

    Can this type of field be used in this comparison? If so, what syntax should replace the "AAAAA"?

  • You haven't stated whether you actually have a problem, but knowing the grief that NTEXT fields can cause, perhaps the best way around it is to transform the source via a query that simply casts the NTEXT field into some form of varchar or nvarchar, and just have that step precede the one that does the conditional split.

    skaggs.andrew (6/17/2014)


    I have a workflow in SSIS where I am using the conditional split transformation. Here is an example of my statement in the condition field:

    ((ISNULL(ENTRYCOMMENT) ? "AAAAA" : ENTRYCOMMENT) != (ISNULL(ENTRYCOMMENT_LKP) ? "AAAAA" : ENTRYCOMMENT_LKP))

    My issue here is this is not a DT_WSTR field, but rather a NTEXT field.

    Can this type of field be used in this comparison? If so, what syntax should replace the "AAAAA"?

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • The only way to know for sure if it works is to try it out.

    Personally, if the field is too large for an ordinay nvarchar, I'd do the comparison in a script component.

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

  • I tried using "AAAAA" and I got an error message, so I guess that means the length of the field is too long. I was just curious if there was something that I was doing wrong or if it needed to be represented in a different way. thanks for the help

  • I ran into this issue and was able to resolve it by casting the string, i.e. replace

    "AAAAA"

    with

    (DT_NTEXT)"AAAAA"

Viewing 5 posts - 1 through 4 (of 4 total)

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