Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Checking for File Existence in File Share - If not exists, check for another file Expand / Collapse
Author
Message
Posted Monday, February 1, 2010 9:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 25, 2014 12:01 PM
Points: 2, Visits: 212
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

Post #857263
Posted Monday, February 1, 2010 9:27 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, November 12, 2012 4:54 PM
Points: 54, Visits: 816
use File.Exists(curFile) ? which returns a boolean

http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx
Post #857298
Posted Tuesday, January 25, 2011 3:52 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, October 24, 2011 3:07 AM
Points: 66, Visits: 315
can you please explain in brief how to use,we have to script task in any loop container

Regards..
guru12
Post #1052984
Posted Tuesday, January 25, 2011 3:58 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, May 30, 2014 6:27 PM
Points: 2,808, Visits: 7,175
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
Post #1052988
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse