File System Task in SSIS

The File System Task in SSIS performs different kinds of operations on Files and Folders (or Directories). For instance, if you want to move the directory content from one location to another, we can use this File System Task.

NOTE: File System Task in SSIS uses the File Connection Manager to connect with the Files and Folders.

Configuring File System Task in SSIS

Drag and drop the SSIS File System Task into the Control Flow region

File System Task in SSIS 1

Double click on it will open the SSIS File System Task Editor to configure it.

  • Name: Please provide the Unique Name
  • Description: Briefly describe the File system task Functionality.
Change Name and Description 2

The File System Task supports ten different operations on Files and Folders. Please see the available options in below SSIS screenshot.

Available Operations 3

SSIS File System Task Operations

OperationDescription
Copy DirectoryCopies a folder from one location to another location. Please refer to Copy Directory Using File System Task article to understand the steps involved in Copying the Directory.
Copy FileCopies a file from one location to another location. Please refer to Copy File Using File System Task article to understand the steps involved in Copying the Files.
Create DirectoryUsing this option, we can create the directory at the specified location.
Delete DirectoryDeletes the selected folder present in the specified location. Please refer to the Delete Directory Using File System Task article to understand the steps involved in Deleting the Directory.
Delete Directory ContentIt Deletes the content present in a selected folder. Please refer to Delete Directory Content to understand the steps involved in Deleting the Directory Content.
Delete FileDeletes the selected file present in the specified location. Please refer to the Delete File Using File System Task for Deleting the Files.
Move DirectoryMoves a folder from one location to another location. Please see the Move Directory Using File System Task article to understand the steps involved in Moving the Directory.
Move FileIt Moves a file from one location to another location. Please see the Move File Using File System Task article for the steps involved in Moving Files. Using the Foreach loop File Enumerator, you can move multiple files. Please visit the Move Multiple Files article.
Rename FileMoves a file from one location to another and renames the file name. Please refer to Rename File Using File System Task to understand the steps in Renaming Files.
Set AttributesWe can use this option to set the attributes for the files and folder. This option includes (Hidden, ReadOnly, System, and Archive options). Please refer to the Setting Attributes Using File System Task article to know the steps involved in Setting or altering the attributes of files and folders.

SSIS File System Task Source Connection

IsSorcePathVariable: This property has two options: True and False. If we set this property to true, the source path is stored in a variable. And if we set this property to false, we must manually select the source path using File Connection Manager.

Set IsSorcePathVariable to True or False 4

If we set the IsSorcePathVariable to true, a new property called SourceVariable appears.

SourceVariable: This SSIS File System Task property displays all the available system and user variables. Please select the appropriate variable holding the Source Path (File or Folder path). If you haven’t created any variable before, please click on the <New Variable..>.

Choose the Source Variable 5

Once you click on the <New Variable..>, a new window called Add Variable will open to create the new variable. Here you can create a new variable that will hold the source path.

File System Task in SSIS 6

And If we set the IsSorcePathVariable False, configure the Source Connection using SourceConnection Property. Select the same from the drop-down list if you have already created the File Connection Manager.

If you haven’t created any connection Manager before, You have to create one by selecting <New Connection..>.

Choose the Source Connection 7

Config Destination Connection of File System Task in SSIS

IsDestinationPathVariable: This File System Task property has two options: True and False. If we set this property to true, the Destination path is stored in a variable. If we set this property to false, select the Destination path manually using File Connection Manager.

File System Task in SSIS 8

For instance, If we set the IsDestinationPathVariable False, we must configure the Destination Connection using DestinationConnection Property. You can pick the File Connection Manager from the drop-down list if you previously created it.

If you haven’t created any connection Manager before, You have to create one by selecting <New Connection..>.

File System Task in SSIS 9

Once you click on the <New Connection..> option, a new window called File Connection Manager Editor opens. Using this, we have to configure the Destination Connection.

File System Task in SSIS 10

Please refer to the File Connection Manager article to understand the configuration.

OverwriteDetination: This SSIS File System Task property has two options: True and False. If we set this property to true, the File System Task overwrites the existing files in the Destination path.

Click OK to finish configuring File System Task Editor.

File System Task in SSIS 2014