SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Package step FTP


SSIS Package step FTP

Author
Message
D-SQL
D-SQL
SSC-Enthusiastic
SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)

Group: General Forum Members
Points: 145 Visits: 778
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
Ray M
Ray M
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2133 Visits: 1076
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/
D-SQL
D-SQL
SSC-Enthusiastic
SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)

Group: General Forum Members
Points: 145 Visits: 778
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
Ray M
Ray M
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2133 Visits: 1076
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?
D-SQL
D-SQL
SSC-Enthusiastic
SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)

Group: General Forum Members
Points: 145 Visits: 778
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.
Ray M
Ray M
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2133 Visits: 1076
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search