File System Task in SSIS

The File System Task in SSIS is used to perform a 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 SSIS 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.
File System Task in SSIS 2

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

File System Task in SSIS 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 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 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 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 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 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.

File System Task in SSIS 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..>.

File System Task in SSIS 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..>.

File System Task in SSIS 7

Config Destination Connection of File System Task in SSIS

IsDestinationPathVariable: This SSIS 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 overwrite the existing files in the Destination path.

File System Task in SSIS 2014

Click OK to finish configuring SSIS File System Task Editor.