Solved

load the latest file from FTP to Target table.

Posted on 2012-04-10
2
463 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
kill all other existing SQL server connection except the login started by current session 65 99
sql query help 2 44
Minus first query 1 36
Storage Spaces 3 39
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Detach & Attach 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.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

911 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

20 Experts available now in Live!

Get 1:1 Help Now