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 2005 Forums
 SSIS and Import/Export (2005)
 Check if file exist ?

Author  Topic 

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-03-31 : 14:26:41
Hi All,

1)My source files[.txt] come from an FTP server.I need to find a way to include within my SSIS package,a task that would watch a certain folder of the FTP Server and send a mail notification as soon as the file arrives.Tried using filewatcher task http://www.sqlis.com/23.aspx, but the task stays "yellow" for a long time while package is being excuted.I dont know if this is what I need to use.Are they any other task/ways?

Another Problem I'm facing is;

2)If the source file coming in the FTP Server is zipped.How do I unzip the file and move it back to the FTP Server folder for the task in 1) to watch on it .Any ideas ?

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2008-03-31 : 14:41:21
I would avoid using FileWatcher, specially on production servers.

For item #1, how are you connecting to your FTP server? Are you planning on FTP'ing to the server to check for the file, do you have the FTP folder mapped locally on your server or are you accessing the file via UNC path?

For item #2, what compression/decompression utility do you have on your servers? I use 7zip across the servers that I need, the sintax is easy and you would use a "Execute Process Task" component to execute the 7zip executable.
Go to Top of Page

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-03-31 : 15:10:52
1# I'm planning to FTP'ing the server to check for the file and I have the FTP folder mapped locally on the server.

2# We currently have winzip installed on the server.
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2008-03-31 : 16:27:37
Is .Net an option for you? Never used this before, but you could check for the file and write the result to a variable. Check this out:
http://sql-server-performance.com/Community/forums/p/3176/17209.aspx#17209

You'll need WinZip cmd line if you want to stick with WinZip or you can always use 7Zip, which is free, fast and support other compression methods as weel.
http://www.winzip.com/prodpagecl.htm
http://www.7-zip.org/
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2008-04-01 : 10:03:48
I got this to work:

http://dichotic.wordpress.com/2006/11/01/ssis-test-for-data-files-existence/
Go to Top of Page

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-04-01 : 11:24:50
Thank You for the site ..I incorporated that in another package of mine that required notification on arrival of file by usind Send Mail task.
Go to Top of Page

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-04-01 : 11:34:01
quote:
Originally posted by igorblackbelt

I got this to work:

http://dichotic.wordpress.com/2006/11/01/ssis-test-for-data-files-existence/




Question:
I have file name coming in as File_104012008.txt
These file might be named differently each time it comes, but the File_1prefix would always be the same.Can I do the following in setting the FileName variable
File_1*.txt? Is there any part else that I would need to change?

Thank You
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2008-04-01 : 12:06:38
Do you always know how's the file going to be called? Is it always current date (...MMDDYYYY.txt)?
If so, you can build the file name using SSIS expressions.
Go to Top of Page

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-04-01 : 12:16:56
I have 3 different file coming from 3 different sources.Therefore I was planning to create 3 separate notification jobs.
Here is the file format
Source 1 = File_042008.txt [04 refers to the month]
Source 2 = File_1_20080104.txt
Source 3 = File_104012008.txt

Maybe you can tell me how I can add the above to the expressions.Thank You !
Go to Top of Page

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-04-03 : 11:11:29
Anyone has advise on this ?
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2008-05-12 : 20:00:05
quote:
Originally posted by igorblackbelt

I got this to work:

http://dichotic.wordpress.com/2006/11/01/ssis-test-for-data-files-existence/




Beaitiful. I love SSIS now.
Go to Top of Page
   

- Advertisement -