Variable no of Excel columns

  • I have a spreadsheet that allows the users to enter additional column values. Meaning some users will have 16 columns and others may have 17 , 18 up to max of 20.

    Is there a way to build this map. I created a map with 20, then when a spreadsheet was read that only had 16 I received a error saying could not find columns 17,18,19,20

    Any help is appreciated.

    Richard

  • SSIS does not like changing schema.

    You could stabilize the schema by using a second workbook that consists of a bunch of formulas that link it to the actual data you want to import. This would allow you to create some formulas that made sure empty columns were available even if users did not enter data. This is a pretty ugly solution though.

    Another option would be to use a script task in your data flow as a source. You could then use a bit of VB to extract the data from the workbook and add it to the output buffer. Again, this would allow you to just put NULL into the empty fields.

    Finally, if you wanted to expand on the last option you could write a custom data source component. It would be nearly the same code as the script task, but if you have to reuse it it would be a bit easier.

  • Would you have any example script ?

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

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