Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to copy or move a text file from a local direc

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2008-02-19 : 08:08:31
Hello All,

I have DTS package that is being ran by a job every morning. The DTS package extract data and saves the result file in a text format in the local directory. My question is how can I copy or move the daily file stored in the local directory to an external directory? Please advice? Thanks.

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-02-19 : 08:26:24
Doe the the FileSystemObject in a DTS ActiveX script , do the job?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-02-19 : 08:26:54
Sorry , I forgot to ask , does it need to be moved by FTP?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2008-02-19 : 08:36:51
add a "execute Process Task" step to DTS IE a batch file
copy c:\temp\myfile.txt \\myserver\mysharedfolder\myfile.txt


"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

pras2007
Posting Yak Master

216 Posts

Posted - 2008-02-19 : 08:54:27
Jack Vamvas,

It does not matter if it is moved by a ftp or not. Thanks.
Go to Top of Page

pras2007
Posting Yak Master

216 Posts

Posted - 2008-02-19 : 09:06:31
jhocutt,

How would you code know which file to copy? The saved text files are in this naming convention: datafile_20080219.txt. Thanks.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-19 : 09:07:47
Based on timestamp??

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

pras2007
Posting Yak Master

216 Posts

Posted - 2008-02-19 : 09:12:35
harsh_athalye,

What format would that be? Thanks.
Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2008-02-19 : 09:13:08
I would copy all files matching a file mask datafile_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].txt
and then archive the local copy by moving it to a sub folder.

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-19 : 09:19:14
or you can add ActivX Script Task in the DTS and copy the file created in local directory to external directory, based on most recent file creation date. (In case of FTP, use EXECUTE PROCESS task)

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -