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

  • 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

  • use File.Exists(curFile) ? which returns a boolean

    http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx

  • can you please explain in brief how to use,we have to script task in any loop container

    Regards..
    guru12

  • 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%5B/url%5D

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply