Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSIS Script task to avoid an Excel Sheet that is empty or with different name convention

Status
Not open for further replies.

4N6Mstr

Technical User
Oct 6, 2008
40
US
Hello all,

I have to import a number of excel spreadsheets. I'm using the classic Foreach Loop inside another Foreach loop approach. The outside loop (Foreach File Enumerator) cycles through the Excel files, while the inside loop (Foreach ADO.NET Schema Rowset Enumerator - ExcelSchema - Tables) to cycle through the individual Excel sheets in each file.

Some of the sheets are empty and I need to skip those, other sheets do not obey the sheet name convention and those too have to be skipped.

My idea is to create a Scrip Task inside the internal loop and use it as a constraint for the Data Flow Task. In case any of the conditions above is met the Data Flow Task is not performed for that sheet and the process advances to the next sheet.

The problem is, I'm not really well versed in Script to be able to accomplish that.

Have any of you had to implement something like that and, if that was the case, do you mind sharing your solution?


Thank you in advance for your suggestions.



Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top