0

I need to create an output CSV file whose some of the column names/descriptions are the same, ie:

ColA   %Total   ColB  %Total

In SSIS Flat File destination, Flat File Connection Manager Editor does NOT allow columns with the same name. There is no Column Description.

Is it possible for a Flat File CSV file to have the same column names?

Thank you

Dale K
  • 25,246
  • 15
  • 42
  • 71
faujong
  • 949
  • 4
  • 24
  • 40
  • It's possible, but I always grumble when I receive files like that because it makes them more difficult to read back in. – AlwaysLearning Aug 21 '23 at 22:02
  • 1
    Have you considered making the first row of your data be the custom column headings and then unticking the "Column names in the first data row" checkbox in the Flat File Connection Editor / General options? – AlwaysLearning Aug 21 '23 at 22:04

1 Answers1

1

Yes it is possible to have the same name for columns in a CSV. Because the CSV "standard" doesn't care about the content of the header row RFC 4180

However, SSIS will raise a bit of a stink as it needs to have a way to uniquely identify the columns. In your Flat File Connection Manager, you'll specify that you have a CSV file with NO HEADER. You'll still need to define column names so name your repeating column names something intuitive, like %Total_ColA and %Total_ColB. Map your columns and run the output. Everything should be good except for the missing header row.

In the Flat File Destination, we're going to use the same approach as Option 2 Create summary rows with detail rows in SSIS The component offers a Header property either in the Dialogue box

enter image description here

or as the Header property

enter image description here

billinkc
  • 59,250
  • 9
  • 102
  • 159