![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Good day, I hope someone can help. I am using the FTP task from SQL Server 2000 DTS. I have an application in place that every day creates a log file with the date as the file name, eg 20050209.txt Every day a new file is created. I need my FTP task to automatically pick up the latest date file. If today is 2005-02-08 then it must use yesterdays file 20050207.txt and load that and so on for each day. The way in which these files are named cannot be changed and the whole process needs to be automated so I can't go and change the file name manually each day or copy the new file somewhere else and rename it. It has to use the existing file name format and do it each day. Please can someone help t.i.a |
#3
| |||
| |||
|
|
Use an ActiveX Script Task. Derive the filename then update the task. Some similar code that derives a filename from a date but for a connection - How can I change the filename for a text file connection? (http://www.sqldts.com/default.aspx?200) Set the task like this, but obviiusly using your filename, not my sample, and remove the folder if not required. Set oFTPTask = oPkg.Tasks("DTSTask_DTSFTPTask_1").CustomTask oFTPTask.SourceFilename = "'test.zip';'filedir"';''" -- Darren Green http://www.sqldts.com http://www.sqlis.com "PLSH" <PLSH (AT) discussions (DOT) microsoft.com> wrote in message news:2CDFE0D5-7204-4D08-9748-B92BE2AC6BD5 (AT) microsoft (DOT) com... Good day, I hope someone can help. I am using the FTP task from SQL Server 2000 DTS. I have an application in place that every day creates a log file with the date as the file name, eg 20050209.txt Every day a new file is created. I need my FTP task to automatically pick up the latest date file. If today is 2005-02-08 then it must use yesterdays file 20050207.txt and load that and so on for each day. The way in which these files are named cannot be changed and the whole process needs to be automated so I can't go and change the file name manually each day or copy the new file somewhere else and rename it. It has to use the existing file name format and do it each day. Please can someone help t.i.a |
#4
| |||
| |||
|
|
Thanks for your help Darren but I receive an error. Object required: 'oPkg' Can you help? "Darren Green" wrote: Use an ActiveX Script Task. Derive the filename then update the task. Some similar code that derives a filename from a date but for a connection - How can I change the filename for a text file connection? (http://www.sqldts.com/default.aspx?200) Set the task like this, but obviiusly using your filename, not my sample, and remove the folder if not required. Set oFTPTask = oPkg.Tasks("DTSTask_DTSFTPTask_1").CustomTask oFTPTask.SourceFilename = "'test.zip';'filedir"';''" -- Darren Green http://www.sqldts.com http://www.sqlis.com "PLSH" <PLSH (AT) discussions (DOT) microsoft.com> wrote in message news:2CDFE0D5-7204-4D08-9748-B92BE2AC6BD5 (AT) microsoft (DOT) com... Good day, I hope someone can help. I am using the FTP task from SQL Server 2000 DTS. I have an application in place that every day creates a log file with the date as the file name, eg 20050209.txt Every day a new file is created. I need my FTP task to automatically pick up the latest date file. If today is 2005-02-08 then it must use yesterdays file 20050207.txt and load that and so on for each day. The way in which these files are named cannot be changed and the whole process needs to be automated so I can't go and change the file name manually each day or copy the new file somewhere else and rename it. It has to use the existing file name format and do it each day. Please can someone help t.i.a |
![]() |
| Thread Tools | |
| Display Modes | |
| |