Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

load the latest file from FTP to Target table.

Posted on 2012-04-10
2
Medium Priority
?
519 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
[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
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 1500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

596 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