Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS Package step FTP Expand / Collapse
Author
Message
Posted Monday, December 3, 2012 8:50 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 3:33 PM
Points: 82, Visits: 667
I have a step that ftp out to a location to grab a file. each month the file name changes, is there a way to filter or have the ftp step pick up the file.

Currently this is the file name 56730_LAF_Layout.xlsx. The only part the changes each month is the first 5 numbers. I tried *_LAF_Layout.xlsx but didnt work does anyone have a suggestions on this?

Thanks in advance
Post #1392001
Posted Monday, December 3, 2012 11:36 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Today @ 8:50 AM
Points: 1,486, Visits: 1,037
Create a variable and set the variable to evalueate as expression = True.
Create an expression that creates the file name as you require.
In the file transfer section of your ftp task, set the IsLocalPathVariable = True, and then select the variable you set up above.
Or remote path, whatever the case may be.


This link will show you how to do everything, Pick out the pieces you need.
http://zlika.org/index.php/2010/06/06/simple-ssis-project-part-1/
Post #1392095
Posted Monday, December 3, 2012 2:22 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 3:33 PM
Points: 82, Visits: 667
Thanks my first step is picking upi the file using the FTP task thats my issue the name changes monthly.

Then I have a few steps importing into the db and then exporting out then FTP out.

My issue is grabbing the file each month
Post #1392143
Posted Monday, December 3, 2012 3:12 PM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Today @ 8:50 AM
Points: 1,486, Visits: 1,037
Ya, this is a fairly common issue.
FTP Task only knows how to process 1 file, and 1 file only the *_Filename.xls your trying won't work.

You need to create a variable to hold the name of the file. Since the file changes and it is dynamic you have to store the name in the variable.

Then configure the ftp task to get the name of the file from the variable.
On your ftp task make sure to set the Delay Validation to True.

The only step left will be to figure out how to populate the variable with the correct name of the file.
Do you know what the first 5 characters of the file name will be each month?

Will there be 1 or many files each month?



Post #1392162
Posted Monday, December 3, 2012 5:35 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Today @ 3:33 PM
Points: 82, Visits: 667
There is only 1 file. The first 5 numbers change we never know what they will be from the client. I did try the *_laf.layout.xlsx but couldnt find it.
Post #1392203
Posted Tuesday, December 4, 2012 9:18 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Today @ 8:50 AM
Points: 1,486, Visits: 1,037
Ok, so create the variable.
Then Configure your ftp task to get the name of the file from the variable.
Create a script task that goes out to the drive and looks for the *_Layout...xlsx file.
then once it finds it, gets the file name and updates the variable with the name.
Post #1392568
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse