Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Dynamic Excel sheet Read Expand / Collapse
Posted Wednesday, June 19, 2013 8:17 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, February 19, 2016 10:02 AM
Points: 26, Visits: 398
Hi guys,
I am new to SSIS. Thanks to SQLCentral it helped me in solving my daily assignments. I have a requirement I have like 10 files in a folder and many of the files have same number of column's but the excel sheet name is changing for few files many of the sheets have same name like sheet1 and some sheets have a different name so how can i dynamically load the data into same table and some sheets have extra column's which can be ignored. When i was trying to load the files with the extra columns it is giving an error saying Meta Data changed and package is failing can any of you guys help me in this.
Post #1465441
Posted Thursday, June 20, 2013 9:25 AM

SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 6:09 AM
Points: 992, Visits: 2,551
We had a similar problem where a CSV file we get supplied either has 275 or 256 columns.

To resolve this we read in the first line of the CSV file and take the length of that line. We then replace the delimiters with nothing and take another count of the length. The difference is the number of delimters. Depending on that we branch out to one of two import steps within the SSIS package.

Hope this helps / points you in right direction
Screen shot attached.

  Post Attachments 
SS1.jpg (6 views, 39.27 KB)
Post #1465775
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse