?
Solved

ssis read filenames from a folder into an object type variable

Posted on 2012-03-09
1
Medium Priority
?
527 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

Accepted Solution

by:
Jason Yousef, MS earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

752 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