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 2008 Forums
 Other SQL Server 2008 Topics
 Import from FTP site

Author  Topic 

Zix
Starting Member

31 Posts

Posted - 2010-01-06 : 15:00:09
This isn't strictly a SQL Server question, but it's part of SS project so thought I would see if anyone happens to know how to do this.

Goal is to import a file from an FTP site. Process has to be automated and occur once every 24 hours.

I know know how to scipt the connection and download and such. The file name is what has me puzzled. The file name changes each day based on the Julian date.

So, the path on the FTP server is something like Data\Folder\file_xxx.zip. The xxx is the julian date of the export. So file_1.zip would be january 1, etc.

So...on January 1 I need to download Data\Folder\file_1.zip;
on January 2 I need to download Data\Folder\file_2.zip;
on January 3 I need to download Data\Folder\file_3.zip;
etc

Any thoughts on where to start with this?

Thanks!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-01-06 : 15:52:48
Pragmatic Works has a "Task Factory" SSIS components, which does both zip-operations and ftp-operations.
Check them out here http://www.pragmaticworks.com/products/business-intelligence/taskfactory/

To get the Julian date, write
SELECT DATEPART(DAYOFYEAR, GETDATE())




N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -