?
Solved

load the latest file from FTP to Target table.

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

800 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