• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

SSIS looping files

How can I loop thru FTP files(.dat) with the latest time stamp and load to sql server using SSIS?
0
Hdase
Asked:
Hdase
1 Solution
 
Jared_SCommented:
For looping through your files, use a script task that utilizes System.IO

(you also make use of the ForEach Loop Container).

Once you find your file name, save it's name as a user variable.

In a data flow, create a flat file data source with the data source as your variable name.

From that data source, process the data however you may need to, and then use a OLEDB or SQL Server destination to load the data into your sql server.

If you run into a specific problem as you go along, post away!
0
 
Alpesh PatelAssistant ConsultantCommented:
no use FTP task to recieve files and Iterate all files using Foreahc task.
0
 
Jared_SCommented:
If the .dat files have not been transferred to you, you will need to use the FTP task to do that first, just as PatelAlpesh points out above.

If you already have the files, there is no need for the FTP task.
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
SThayaTechnical MAnagerCommented:
For Step by Step Example , Refer the belwo


http://www.code-magazine.com/article.aspx?quickid=1008061&page=4
0
 
HdaseAuthor Commented:
I can do all the For each loop, FTP task operations fine...but the problem is getting the files with the latest file stamp from the FTP. Is there a way of doing it short of using the script task?
If using the script task is the only solution, I would appreciate if any body can provide a sample code.

Here are sample files:
        daily.Data.1208.20120914140626.dat.....this is what I want
        daily.Data.1207.20120914130627.dat......not this one


---thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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