Solved

ssis read filenames from a folder into an object type variable

Posted on 2012-03-09
1
514 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:
huslayer earned 500 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

763 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now