Dealing with commas in text fields when exporting to .csv via SSIS

  • Hello All,

    Whenever I've worked with SSIS in the past I've always exported my data to Excel files, but now I have a project where everything needs to be stored in .csv files. The problem I've run into is when exporting my data from SSIS to a .csv is that some of the text fields contain commas inside the field data and therefore is treated as the field delimiter. How can I get around this?

    Thanks!

  • Add a "text qualifier" in the export definition. The usual is double-quotes. Or use tabs instead of commas as the delimiter, if you can. .csv files work with either, in most cases. Can work with pipes (also called "vertical bar"; key above Enter on your keyboard, shift-backslash), too.

    You can specify any of those options in the SSIS connection to the destination.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks, GSquared!

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

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