Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Dynamic Excel sheet Read Expand / Collapse
Author
Message
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, September 19, 2014 9:39 AM
Points: 25, Visits: 335
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-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 5:10 AM
Points: 434, Visits: 1,346
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