Rename File Using File System Task in SSIS

In this article, we show you how to Rename File Using SSIS File System Task with example. To Move the File, Please refer to Move File Using File System Task article present in the SSIS page.

We have File System Task Folder inside the MSBI Folder. Our task is to move the GEOGRAPHY.txt file inside the File System Task Folder to Copied Folder inside F Drive and rename it.

Rename FIle Using File System Task in SSIS

Files inside the Copied folder are:

Rename FIle Using File System Task in SSIS

Rename File Using File System Task in SSIS

To Rename File Using File System Task in SSIS, Drag and drop the File System Task into the Control Flow region and rename it as Rename File Using File System Task in SSIS

Rename FIle Using File System Task in SSIS 1

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

In this example, We are Renaming the existing file. So, lease change the operation property to Rename File

Rename FIle Using File System Task in SSIS 2

Let us configure the Source Connection by selecting the SourceConnection property. If you already created the File Connection Manager before then select the created one or If you stored the Source Connection in the Variable then, please change the IsSourcePathVariable property to TRUE and select the Variable Name.

Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.

Rename FIle Using File System Task in SSIS 3

Once you click on the <New Connection..>, File Connection Manager Editor will open to configure it. In this example, we are Renaming the existing File. So select the Existing File option from the Usage Type.

Click on the Browse button to select the Existing File from the file system.

Rename FIle Using File System Task in SSIS 4

From the above screenshot, you can observe that we selected the GEOGRAPHY.txt File inside the File System Task Folder

Rename FIle Using File System Task in SSIS 5

Click Ok to finish configuring the Source connection.

Now we have to configure the Destination Connection so, Please select the DestinationConnection property. If you already created the File Connection Manager before then select the created one or If you stored the Destination Connection in the Variable then, please change the IsDestinationPathVariable property to TRUE and select the Variable Name.

Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.

Rename FIle Using File System Task in SSIS 6

In this example, we are moving the existing file and renaming it. So, we are selecting Create File option from the Usage Type.

Rename FIle Using File System Task in SSIS 7

Click on the Browse button to select the Destination Folder from the file system.

Rename FIle Using File System Task in SSIS 8

From the above image, you can observe that we created the New text file called NewGeography.txt inside the Copied Folder. Click the Open button to create it.

Rename FIle Using File System Task in SSIS 9

Click Ok to finish configuring the File Connection Manager for the destination.

Rename FIle Using File System Task in SSIS 10

Lastly, Click Ok to finish configuring Rename File Using File System Task in the SSIS package. Let’s run and see whether we successfully renamed the Geography.txt file using the File System Task or Not.

Rename FIle Using File System Task in SSIS 11

Well, We successfully Moved the Geography.txt file present in the File System Task Folder to the Copied Folder and renamed the file as NewGeography.txt.

Rename FIle Using File System Task in SSIS 12