Run the foreach loop container if file exist

  • Hi All,

    In my SSIS Package I am using For each loop container to load the data from csv file to SQL Table.

    my file will be like abc_120554.csv

    I want to places one script task before the foreach loop container to check if the file exist in the folder which start with abc_

    what to do for same.

    Regards,

    Vipin Jha

  • Is there a reason you want to stop the package if there is no file? If there is no file, package wouldn't do anything anyways and just complete. No need to do anything.

    If there is a reason to stop the package, Check out the link below. Use a script task to check for a file then write to a boolean variable. Then use the variable in precedence constraint redirect package to stop. Let me know if this makes sense.

    https://msdn.microsoft.com/en-us/library/system.io.file.exists(v=vs.110).aspx

    ------------
    🙂

Viewing 2 posts - 1 through 1 (of 1 total)

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