Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 535
  • Last Modified:

ssis read filenames from a folder into an object type variable

1. I am extracting a zip file in a folder. I want to read all the extracted file names from that folder in a script task (string[] file_names = Directory.GetFiles(@"c:\MyDir\", "*.pdf");)).
2. Now, I want to write the array file_names in an SSIS object type variable, so that I can insert each file name in a table and use it for my comparison and further processing.

How do I accomplish step 2 ?
0
patd1
Asked:
patd1
1 Solution
 
Jason Yousef, MSSr. BI DeveloperCommented:
You can do step 1 without a script task, using a "FOR EACH LOOP Container"
This link will help you...http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx

Anyway if you still want to use a script task, please post your current FULL script, so I can test and integrate step 2.

Ragards,
Jason
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now