Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Variable no of Excel columns


Variable no of Excel columns

Author
Message
RC-874851
RC-874851
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 42
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
Michael Earl-395764
Michael Earl-395764
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2711 Visits: 23078
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.
RC-874851
RC-874851
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 42
Would you have any example script ?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search