Solved

ssis read filenames from a folder into an object type variable

Posted on 2012-03-09
1
517 Views
Last Modified: 2012-03-12
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
Comment
Question by:patd1
1 Comment
 
LVL 21

Accepted Solution

by:
Jason Yousef, MS earned 500 total points
ID: 37704980
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question