SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Checking for File Existence in File Share - If not exists, check for another file


Checking for File Existence in File Share - If not exists, check for another file

Author
Message
kirank5
kirank5
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 273
I have read about using script task to check the existence of a file in a directory or a file share. I have a similar requirement, with slight variation:

I have a table which lists the list of text files, for which I have to check if they exist on the file share. Say for example I have test1.txt, test2.txt, test3.txt etc. I have to check to see if test1.txt is present on the file share, if so, grab it and process the file. If test1.txt is not present, move on to find out if test2.txt is present, if it is present process the file, if it is not present on the file share, move on to see if the next file, which is test3.txt is present on the file share..

Can anybody please provide me with input on how to go about this requirement?

Thanks
Kay
yosiasz
yosiasz
SSC-Enthusiastic
SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)SSC-Enthusiastic (113 reputation)

Group: General Forum Members
Points: 113 Visits: 821
use File.Exists(curFile) ? which returns a boolean

http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx
guru12
guru12
SSC Journeyman
SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)SSC Journeyman (96 reputation)

Group: General Forum Members
Points: 96 Visits: 315
can you please explain in brief how to use,we have to script task in any loop container

Regards..
guru12
steveb.
steveb.
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4368 Visits: 7195
guru12 (1/25/2011)
can you please explain in brief how to use,we have to script task in any loop container


you already have a thread going with this question

http://www.sqlservercentral.com/Forums/Topic1052867-148-1.aspx
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search