November 2, 2010 at 1:03 am
Hi All,
how to implement the below req in SSIS:
how to find out whether any file is present in the specified folder.
Note: we dont know about the file name. Just we need to check whether any files present or not.
Thanks in Advance.
November 2, 2010 at 2:51 am
It depends, largely.
Please google WQL
Raunak J
November 2, 2010 at 3:05 am
Depends on what you will do next.
You might just be able to use a Foreach loop and put your 'file(s) found' processing inside it.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 2, 2010 at 3:54 am
You may find xp_fileexists extended stored procedure useful. More information on this XP here
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
November 2, 2010 at 4:01 am
as another suggestion; the way we do it is to use a script task with the File.Exists Method
http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx
November 2, 2010 at 4:06 am
One of the suitable approach would be to watch the said directory using a FileSystemWatcher and fire appropriate events as associated. This seems doable as the system does not deems necessary for a filename to be known.
Raunak J
November 2, 2010 at 4:30 am
Hi,
Use Script Task go to design script
U can write C# or VB Script for the same
Cheers!
Sasidhar Pulivarthi
November 2, 2010 at 4:32 am
Pulivarthi Sasidhar (11/2/2010)
Hi,Use Script Task go to design script
U can write C# or VB Script for the same
Cheers!
Sasidhar Pulivarthi
What does this give the OP that Steveb's post did not?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 2, 2010 at 4:38 am
Phil Parkin (11/2/2010)
Pulivarthi Sasidhar (11/2/2010)
Hi,Use Script Task go to design script
U can write C# or VB Script for the same
Cheers!
Sasidhar Pulivarthi
What does this give the OP that Steveb's post did not?
In any case, File.Exists() cannot be used :-):-):-)
Raunak J
November 2, 2010 at 4:44 am
True 🙂
Directory.GetFiles will probably do the job.
But so will a FEL, without the need for any code.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 2, 2010 at 4:52 am
Think Big...Think Windows Service that will poll a directory implementing Windows Management Instrumentation Events..lol...
Yes Phil FEL can be used but the ST has to invlove a suitable code for threading to minimize the resource usage for all the time as long as file is not found...So a better approach should be a WQL/FileSystemWatcher as it will keep the package in dormant state as long as file is not found at the designated root folder.;-)
Raunak J
November 2, 2010 at 4:59 am
You are using a lot of guesswork here.
A quote from the original post:
how to find out whether any file is present in the specified folder.
Note: we dont know about the file name. Just we need to check whether any files present or not.
..and that's it.
You have somehow extrapolated an extravagant requirement from this. Maybe the check needs to be done only once a day/week/month - who knows?
I suspect you have the geek-defect gene installed 🙂
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 2, 2010 at 5:08 am
Phil Parkin (11/2/2010)
You are using a lot of guesswork here.
Somehow, I don't think so. 🙂
Raunak J
November 2, 2010 at 9:17 am
Raunak Jhawar (11/2/2010)
Think Big...Think Windows Service that will poll a directory implementing Windows Management Instrumentation Events..lol...Yes Phil FEL can be used but the ST has to invlove a suitable code for threading to minimize the resource usage for all the time as long as file is not found...So a better approach should be a WQL/FileSystemWatcher as it will keep the package in dormant state as long as file is not found at the designated root folder.;-)
A VB task could very quick get a count of the files in a directory.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply