Solved

load the latest file from FTP to Target table.

Posted on 2012-04-10
2
468 Views
Last Modified: 2012-08-13
Hi,

Requirement : Need to copy the latest  CSV file from FTP Shared drive to my local machine and then need to load it to the Target Table(SQL SERVER 2008) using the SSIS 2008.

Step 1:  Will get the latest file from the FTP Drive using the Script task  as mentioned below

http://www.rad.pasfu.com/index.php?/archives/30-Find-Last-Created-File-in-Special-Directory-SSIS.html

Step 2

After getting the latest file (with time stamp) , I am unsure how to copy it to the folder in my local machine and then rename the file to  a Specified Name("ContactDetails")  as mentioned in the Flat file Connection Manager ?

Example: Files in the FTP Shared Drive

ContactDetailsApril6.csv
ContactDetailsApril7.csv
ContactDetailsApril8.csv
ContactDetailsApril9.csv
ContactDetailsApril10.csv

Here ContactDetailsApril10.csv is the latest file


Could you please help me with the solution in detail and also please suggest that solution mentioned in Step 1 works fine.

Regards,

Sreekanth.
0
Comment
Question by:n_srikanth4
2 Comments
 
LVL 14

Expert Comment

by:nishant joshi
ID: 37829033
you have to use ft task for ftp which use for copy file ftp to your location you can use expressions for that to copy files.

and for load in table use dataflow task in which use flate file source and destination as a oldb destination which is to your sql table.

Regards,
nishant
0
 
LVL 11

Accepted Solution

by:
SThaya earned 500 total points
ID: 37831856
1. create 2 variables
Variable 1 : Latest File name
Variable 2 : Local Folder Filename

.---> Variable 1 : this data you will get from your step 1

2. in Control flow drag and drop the "FTP Task " .Set  the the connection and select the opeartion (move the file to the local folder )

Refer :http://f5debug.net/2011/03/15/sql-server-integration-services-ssis-%E2%80%93-part-22-%E2%80%93-receive-file-using-ftp-task-in-ssis-package/

3. place the Script task will assign the "Variable 2 : " file name .

3. Drag and Drop the DataFlow task  and Edit -->set the data sorce as " Flat File " 

4. in the flatfileCooection window -->right click ---> properties --> select Expession and set the connection string expression as  [Variable 2 :] this will change your file name automatically.


5 oledb destination will hold your incoming data
Untitled.png
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

11 Experts available now in Live!

Get 1:1 Help Now