Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Nested Foreach Container?

Author  Topic 

jstikal
Starting Member

19 Posts

Posted - 2015-01-13 : 19:40:19
I am wanting to insert data into a table based on folder descriptions, file descriptions, and content within files.

I have multiple folders which I want to insert the folder description as an attribute within a table. Next multiple files within each folder and each .csv file description as an attribute and then the content within each folder in the table. Can a foreach container be nested? Any help would be greatly appreciated. Thank you!

To summarize:

Folder #1
File #1 (.csv)
File#1.First
File#1.Last
File #2 (.csv)
File#2.First
File#2.Last
Folder #2
File #1 (.csv)
File#1.First
File#1.Last
File #2 (.csv)
File#2.First
File#2.Last

The table should look as follows:

FolderName FileName First Last
1 1 John Smith
1 1 Jim Jones
1 2 Sara Black
1 2 Jan White
2 1 Bob Blue
2 1 Jeremy Red
2 2 John Pink
2 2 Fred Silver

viggneshwar
Yak Posting Veteran

86 Posts

Posted - 2015-01-21 : 04:06:28
Foreach container can be used for this scenario. To retrive the descriptions you could use Script task

Regards
Viggneshwar A
Go to Top of Page
   

- Advertisement -