dbTalk Databases Forums  

Dynamically FTP file

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Dynamically FTP file in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PLSH
 
Posts: n/a

Default Dynamically FTP file - 02-09-2005 , 05:57 AM






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


Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Dynamically FTP file - 02-09-2005 , 10:37 AM






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

Quote:
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




Reply With Quote
  #3  
Old   
PLSH
 
Posts: n/a

Default Re: Dynamically FTP file - 02-10-2005 , 01:33 AM



Thanks for your help Darren but I receive an error.

Object required: 'oPkg'

Can you help?

"Darren Green" wrote:

Quote:
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





Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: Dynamically FTP file - 02-10-2005 , 05:02 AM



That was only a snippet of code, not the full function.

oPkg would be the package object, e.g.

Dim oPkg
Set oPkg = DTSGlobalVariables.Parent


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com


"PLSH" <PLSH (AT) discussions (DOT) microsoft.com> wrote

Quote:
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







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.