Your understanding is correct - SSIS is very pendantic. You can use the Create directory option on an upstream File System Task, but it may be easier to manage both operations in a Script component, where you can use Try ... Catch etc.
SSIS Filesystem Task, create a new directory
-
30-06-2023 - |
Question
This may be impossible, but i'm wondering why there's no option to allow the filesystem task to create new directories if they don't exist.
I have a package which finds specific directories on a target machine, then reads the files before inserting specific parts into a database. Finally, i want to let the package archive the finished files, by moving them to a sub-dir "Archive" within the same dir as the source files.
So i created a script task to fill a variable with the intended Directory Path (which doesn't exists yet) and used the filesystem task to "move" the files to the desination variable. But unless i create the new archive directories first, i cannot use the task as it fails with:
[File System Task] Error: An error occurred with the following error message: "Could not find a part of the path.".
Is this really not possible?
I know i could script it in the same place where i derive the new archive path and just create it first using a Filesystem object, but i would have expected this task to create directories which don't currently exist. Can someone confirm please?
Thanks
Solution