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
 Import/Export (DTS) and Replication (2000)
 DTS FTP Question

Author  Topic 

BigRetina
Posting Yak Master

144 Posts

Posted - 2005-12-25 : 07:53:13
Hello,

I am a bit nwe to DTS. So forgive my ignorance.
I need to transfer 3 files from an FTP server. The file names are as follows:

FileA25122005.txt
FileB25122005.txt
FileC25122005.txt

The files will change thier names to include the TODAY date as can be seen from the above files names. So i need the FTP task to get whatever text files on the server and get them to me. Then I want to Import those files into my database. I already created 3 packages to import the 3 files..but how can i make the file name dynamic? then i need to move the files to an archive folder..again the file name should be dynamic.

I appreciate your help and guidance.

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-12-25 : 13:21:20
what front end are you using to access these files ?

VB, ASP OR .NET ?

if you are just looking to import them, you really dont need ftp. Just simply use DTS

Depending on the frontend, you could write a script to get what you want done

afrika
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-26 : 00:54:32
Refer these
http://www.nigelrivett.net/FTP/s_ftp_PutFile.html
http://www.nigelrivett.net/FTP/s_ftp_GetFile.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

mcarahul
Starting Member

11 Posts

Posted - 2005-12-29 : 05:57:36
Take the global variables in ur DTS. These can be updated by sysdate value dynamically. Then files can be ftp'd from any server with the desired name.
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2006-01-05 : 13:36:57
I make use of bat files, have your dts package with a bat file that get or put a file wherever you want, you can make use of global variables that can change as you desire.

---

Thanks!
Igor.
Go to Top of Page

nojcom
Starting Member

1 Post

Posted - 2006-01-11 : 18:15:02
BigRetina's problem is very simliar to my own but instead of importing the txt to a specific location I was wondering how to import txt files directly into a table from an ftp location. I have experimented with the dts packages and looked high and low on the web for a solution . All solutions tend to want to store the imported files in a local directory and then transform them to the appropriate database tables. I would like to skip this step as I am working with a remote ms sql server and a remote ftp server.

Any help would be much appreciated. I'm sure it is a simple proceedure that is at the moment eluding me.
Go to Top of Page
   

- Advertisement -