File System Task in SSIS

The File System Task in SSIS is used to perform 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
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 Using File System Task 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 to know the steps involved in 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 to know the steps involved in Moving Files.
Rename FileMoves a file from one location to another location and renames the file name. Please refer Rename File Using File System Task to understand the steps involved in Renaming Files.
Set AttributesUsing this option, we can 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, then the source path is stored in a variable. And, if we set this property to false, we have to select the source path manually using File Connection Manager.

Set IsSorcePathVariable to True or False 4

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

SourceVariable: This SSIS File System Task property displays all the available system and user variables. Please select the appropriate variable which is 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..>, it will open the new window called Add Variable to create the new variable. Here you can create the new variable which 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. If you already created the File Connection Manager, select the same from the drop-down list.

If you haven’t created any connection Manager before, You have to create 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 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 have to configure the Destination Connection using DestinationConnection Property. If you previously created the File Connection Manager, you can pick it from the drop-down list.

If you haven’t created any connection Manager before, You have to create 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 opened. 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