Omit quotes in string

  • In the input file i get have got many " (double quotes) in one of the column.

    I use SSIS to transfer the data from flt afile to sql server table.

    The problem i face is the string is 60 char long but without quotes.

    Now, I want to replace " (double quotes) so that only 60 char goes to my SQL tabl

    And i do not know what query should I use in derived column to replace quotes.

    eg:

    the input file has data like :

    "uitgebr.rep.perif.zenuw znd transpl., tweede en vlgnde zenuw"

    (it has length 62)

    and i need result as

    uitgebr.rep.perif.zenuw znd transpl., tweede en vlgnde zenuw

    (i need length 60, omitting " )

  • this works for me!!

    RTRIM(LTRIM(REPLACE(mycol,"\""," ")))

    If there is any better way let me know!

  • This was removed by the editor as SPAM

  • Big fan of REPLACE()

    Think great, be great!

  • I believe using TRIM() would give the following error:

    Msg 195, Level 15, State 10, Line 3

    'TRIM' is not a recognized built-in function name.

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

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