Copy data if the file exists using the SSIS validation task

The article demonstrates how to copy a file or perform another action based on whether the file exists or not. Here’s a summary of the steps and you can click here for our article Validation task:

  • Drag and drop a Validation Task into the control flow.

  • Configure the task by selecting the action Check if file exists (Single file or pattern). Choose the file you want to check, and click Ok to save the configuration. We used a variable in the path for this example

  • Drag and drop the Advanced File System Task to perform an action if the file exists. For example, use the action Copy file(s). Utilize a variable for the source path and then select the destination path.

  • Run the package. The file should be copied to the new location if it exists. A Logging Task is used to capture the result.
    image

  • In the case of a non-existent file, the component fails, and the failure result is logged.
    image

This example illustrates how to conditionally perform tasks based on the existence of a file, enhancing the control flow in your SSIS package. If you encounter any issues or need further assistance, feel free to contact our support team via chat on our website or through email at support@zappysys.com.