escape single quote in a column

  • We have a SSIS package that pulls data from an oracle database and output to a flat file extract.

    The end user complains that the middle name one person has has a single quote in between two words, so it caused the failure of import of the extract.

    So we need to remove the single quote in the middle name for them in the extracts.

    How can I achive that?

  • My 2 cent;

    An apostrophe is a valid character in a surname so that should be catered for.

  • Eirikur Eiriksson (3/26/2014)


    My 2 cent;

    An apostrophe is a valid character in a surname so that should be catered for.

    I agree - if you remove these, you are changing people's names.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Sorry, check the requirement with the user again, she modified the requirment, it is actually the user entered middle name with a double quote around it, the case is like this:

    On the user interface, it is entered:

    Last name: Helm

    First name: Herminia

    Middle name: "Minia"

    Prefered name: Minia

    In the extract, we only pulll firstname, lastname, and middle initial, so the middle initial turns out to be "

    and cause the user importing from the extract flat file fail.

    How to avoid this in code?

    Thanks,

  • One suggestion is to use derived column and the replace function inside the left function.

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

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