Dynamic Folder Naming SSIS

ssis, task

Solution

You need to write `expression` for getting dynamic values for the folder name. Lets say you have a package like the one below

The 1st component is an `execute SQL Task` which retrieves the ID from a table values like `123, 133, 143`

`ForEach component` enumerates these values and passes on the `individual ID` to the `File System Task` (Create Folder) to create folder with dynamic names.

Step 1: Create 3 variable in SSIS

Name        DataType  Expression
ID           Int32
FolderPath   String   "D:\\Outbox\\ACI\\" + (DT_WSTR, 10) @[User::ID] 
FileID       Object  

For the variable FolderPath Set `EvaluateAsExpression` as True

Step 2: Configure the Execute SQL Task to get the ID's from the table

Step 3: Store the ID's into a `FileID` variable

Step 4: Configure `ForEach` component

Step 5: Configure File System task to create a `directory`

Problem

Is there a way I could dynamically create a destination folder during SSIS execution without using Script Task, say for eg. I have codes 123, 133, 143 and I want to create a folder location below if such does not exist ``` D:\Outbox\ACI\123 D:\Outbox\ACI\133 D:\Outbox\ACI\143 ``` D:\Outbox\ACI is static while the 123, 133, 143 just came off as a result of an Execute SQL Query Component. Anyone please?

Original source