Here i am going to explain, how to create a folder (folder name is current date 'YYYYMMDD') in SSIS using 'File System Task'.
- Create three variables
- Folder_Path
- Folder_Name
- Full_Path
Variable Name | Data Type | Value/Expression | |||||||||||||||||||||||||||
Folder_Path | String | D:\ (Give required path) | |||||||||||||||||||||||||||
Folder_Name | String | SUBSTRING((DT_WSTR,
10) (DT_DBDATE) GETDATE(), 1,4) +SUBSTRING((DT_WSTR, 10) (DT_DBDATE) GETDATE(), 6,2) +SUBSTRING((DT_WSTR, 10) (DT_DBDATE) GETDATE(), 9,2) | |||||||||||||||||||||||||||
Full_Path | String | @[User::Folder_Path]+ @[User::Folder_Name] |
- Take 'File System Task' and edit.
- Select "Operation" as "Create Directory" from the drop-down list.
- Set "IsSourcePathVariable" as "True"
- Select "Full_Path" Variable from the "SourceVariable" Drop-down list.
- Click on "OK" Button and run the package.