In message <6168E0A5-8A20-4319-81C1-7AD2E7C4DB44 (AT) microsoft (DOT) com>, Lenny
<lp (AT) TNSIntersearch (DOT) com> writes
Quote:
Hi,
I need a DTS package that would download files from remote ftp site
everyday. Files names would be determine dynamically based on the
current date e.g. mmddyyyyFilename.csv. Is FTP task flexible enough to
handle this kind of scenario? If yes, how do you set it up?
Thank you |
You can do this, but you will need to use an ActiveX Script Task to
manipulate the FTP task-
Dim oPkg
' Get current package instance
Set oPkg = DTSGlobalVariables.Parent
' Get existing FTP task by name
' Note, name may need to be changed to match your FTP task
Set oFTPTask = oPkg.Tasks("DTSTask_DTSFTPTask_1").CustomTask
' Set properties of FTP task
oFTPTask.SourceFilename = "'test.zip';'filedir"';''"
' Clean Up
Set oFTPTask = Nothing
Set oPkg = Nothing
You will need to change "test.zip" toy you filename, derived using the
VBScript date functions. Note the 3 part format of SourceFilename, as
documented in Books Online.
An example of deriving filenames from dates cane be found here-
How can I change the filename for a text file connection?
(http://localhost/SQLDTSNet/default.aspx?200)
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org