Friday, July 17, 2015

File System Task



File System Task in SSIS 2014


In SQL Server Integration Services, File System Task is used to perform different kind of operations on Files and Folders (or Directories). For instance, if you want to move the directory content from one location to other we can use this File System Task.
NOTE: File System Task uses the File Connection Manger to connect with the Files and Folders.

Configuring File System Task in SSIS 2014

Drag and drop the File System Task into the Control Flow region
File System Task in SSIS 1
Double click on it will open the File System Task Editor to configure it.
  • Name: Please provide the Unique Name
  • Description: Briefly describe the Task Functionality. It is always a good practice to provide the valid description.
File System Task in SSIS 2
In SSIS, File System Task supports ten different operation on Files and Folders. Please see the available options in below screenshot
File System Task in SSIS 3
OperationDescription
Copy DirectoryCopies a folder from one location to another location. Please refer Copy Directory Using File System Task in SSIS article to understand the steps involved in Copying the Directory
Copy FileCopies a file from one location to another location. Please refer Copy File Using File System Task in SSIS article to understand the steps involved in Copying the Files
Create DirectoryUsing this options, We can create the directory at the specified location.
Delete DirectoryDeletes the selected folder present in the specified location. Please refer Delete Directory Using File System Task in SSIS article to understand the steps involved in Deleting the Directory
Delete Directory ContentDeletes the content present in a selected folder. Please refer Delete Directory Content Using File System Task in SSIS article 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 in SSIS article to understand the steps involved in Deleting the Files
Move DirectoryMoves a folder from one location to another location. Please refer Move Directory Using File System Task in SSIS article to understand the steps involved in Moving the Directory
Move FileMoves a file from one location to another location. Please refer Move File Using File System Task in SSIS article to understand 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 in SSIS article to understand the steps involved in Renaming Files
Set AttributesUsing this options, We can set the attributes for the files and folder. This option includes (Hidden, ReadOnly, System and Archive options). Please refer Setting Attributes Using File System Task in SSIS article to understand the steps involved in Setting or altering the attributes of a files and folders.
Source Connection
IsSorcePathVariableThis property has two options: True and False. If we set this property to true then source path is stored in a variable. If we set this property to false then we have to select the source path manually using File Connection Manger.
File System Task in SSIS 4
If we set the IsSorcePathVariable to true then new property called SourceVariable will be appeared.
SourceVariable: This 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 then please click on the <New Variable..> as shown in the below screenshot.
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
If we set the IsSorcePathVariable False then we have to configure the Source Connection using SourceConnection Property. If you already created the File Connection Manager you can simply select it from the drop down list.
If you haven’t created any connection Manager before, You have to create by selecting <New Connection..>. as shown in below screenshot.
File System Task in SSIS 7
Destination Connection
IsDestinationPathVariableThis property has two options: True and False. If we set this property to true then Destination path is stored in a variable. If we set this property to false then we have to select the Destination path manually using File Connection Manger.
File System Task in SSIS 8
If we set the IsDestinationPathVariable False then we have to configure the Destination Connection using DestinationConnection Property. If you already created the File Connection Manager you can simply select it from the drop down list.
If you haven’t created any connection Manager before, You have to create by selecting <New Connection..> as shown in below screenshot.
File System Task in SSIS 9
Once you click on the <New Connection..> option, a new window called File Connection Manager Editor will be opened as shown in the below screenshot. Using this we have to configure the Destination Connection.
File System Task in SSIS 10
Please refer File Connection Manager article to understand the configuration.
OverwriteDetination: This property has two options: True and False. If we set this property to true then File System Task will overwrite the existing files in the Destination path.
File System Task in SSIS 2014
Click Ok to finish configuring File System Task Editor.
Thank You for Visiting Our Blog.





Copy Directory Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to Copy the Directory from one location to another location Using SSIS File System Task with example. To Move the complete Directory, Please refer Move Directory Using File System Task article.
We have File System Task Folder inside the MSBI Folder. Below screenshot shows you the data inside that folder. Our task is to Copy the SSIS Blogger pics folder inside the File System Task Folder to Copied Folder inside F Drive.
Copy Directory Using File System Task in SSIS
Files inside the Copied folder are:
Copy Directory Using File System Task in SSIS
Drag and drop the File System Task into the Control Flow region and rename it as Copy Directory Using File System Task
Copy Directory 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 Copying directory so, Please change the operation property to Copy Directory as shown in the below screenshot
Copy Directory 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.
Copy Directory Using File System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are Copying existing directory so we are selecting Existing Folder option from the Usage Type 
Copy Directory Using File System Task in SSIS 4
Click on the Browse button to select the Existing Folder.
Copy Directory Using File System Task in SSIS 5
From the above screenshot you can observe that, We selected the SSIS BLOGGER pics folder inside the File System Task Folder
Copy Directory Using File System Task in SSIS 6
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..>.
Copy Directory Using File System Task in SSIS 7
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. Click on the Browse button to select the Existing Folder.
Copy Directory Using File System Task in SSIS 8
From the above the above screenshot you can observe that, We selected the Copied Folder by clicking the Ok button.
Copy Directory Using File System Task in SSIS 9
Click Ok to finish configuring the File Connection Manager for the destination.
Copy Directory Using File System Task in SSIS 10
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully Copied the Directory using the File System Task or Not.
Copy Directory Using File System Task in SSIS 11
Well, We successfully Moved the SSIS blogger pics directory present in the File System Task Folder to the Copied Folder Directory.
Copy Directory Using File System Task in SSIS 12
Thank You for Visiting Our Blog.





Copy Files Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to Copy File from one location to another location Using SSIS File System Task with example. To Copy the complete Directory, Please refer Copy Directory Using File System Task article.
TIP: Please use the For each Container to Copy multiple files from one location to another location.
We have File System Task Folder inside the MSBI Folder. Below screenshot shows you the data inside that folder. Our task is to Copy the cache.xml file inside the File System Task Folder to Copied Folder inside F Drive.
Copy Files Using File System Task in SSIS 1
Files inside the Copied folder are:
Copy Files Using File System Task in SSIS 1
Drag and drop the File System Task into the Control Flow region and rename it as Copy File Using File System Task in SSIS
Copy Files 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 Copying single file so, Please change the operation property to Copy File as shown in the below screenshot
Copy Files 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.
Copy Files Using File System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are Copying existing file so we are selecting Existing File option from the Usage Type.
Click on the Browse button to select the Existing File from the file system.
Copy Files Using File System Task in SSIS 4
From the above screenshot you can observe that, We selected the Cache.xml file inside the File System Task Folder
Copy Files 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..>.
Copy Files Using File System Task in SSIS 6
In this example we are Copying existing file to the already existing folder so, we are selecting Existing Folder option from the Usage Type.
Copy Files Using File System Task in SSIS 7
Click on the Browse button to select the Existing Folder from the file system.
Copy Files Using File System Task in SSIS 8
From the above the above screenshot you can observe that, We selected the Copied Folder as the destination folder. Click Ok button to select it.
Copy Files Using File System Task in SSIS 9
Click Ok to finish configuring the File Connection Manager for the destination.
Copy Files Using File System Task in SSIS 10
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully Copied the Cache.xml file using the File System Task or Not.
Copy Files Using File System Task in SSIS 11
Well, We successfully Copied the Cache.xml file present in the File System Task Folder to the Copied Folder.
Copy Files Using File System Task in SSIS 12
Thank You for Visiting Our Blog.





Delete Directory Content Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to delete the Directory Content Using SSIS File System Task with example. To delete Directory, Please refer Delete Directory Using File System Task in SSIS article.
We have File System Task Folder inside the Music Folder. Below screenshot shows you the data inside that folder. Our task is to delete all the content inside the File System Task Folder (.xml, .xls, .txt files and the SSIS Blogger pics folder as well).
Delete Directory Content Using File System Task in SSIS 2014
Drag and drop the File System Task into the Control Flow region and rename it as Delete Directory Content Using File System Task
Delete Directory Content 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 deleting directory content so, Please change the operation property to Delete Directory Content as shown in the below screenshot
Delete Directory Content 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.
Delete Directory Content Using File System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are deleting directory content so we are selecting Existing Directory option from the Usage Type 
Delete Directory Content Using File System Task in SSIS 4
Click on the Browse button to select the Existing Folder.
Delete Directory Content Using File System Task in SSIS 5
From the above the above screenshot you can observe that, We selected the File System Task Folder
Delete Directory Content Using File System Task in SSIS 6
Click Ok to finish configuring the File Connection Manager.
Delete Directory Content Using File System Task in SSIS 7
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully deleted the Directory Content using the File System Task or Not.
Delete Directory Content Using File System Task in SSIS 8
Well, We successfully deleted the Content present in the File System Task Folder or Directory.
Delete Directory Content Using File System Task in SSIS 9
Thank You for Visiting Our Blog.





Delete Directory Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to delete Directory Using SSIS File System Task with example. To delete Directory content, Please refer Delete Directory Content Using File System Task in SSIS article.
We have File System Task Folder inside the Music Folder. Below screenshot shows you the data inside that folder. Our task is to delete the SSIS Blogger pics folder inside the File System Task Folder.
Delete Directory Content Using File System Task in SSIS 2014
Drag and drop the File System Task into the Control Flow region and rename it as Delete Directory Using File System Task
Delete Directory 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 deleting directory so, Please change the operation property toDelete Directory as shown in the below screenshot
Delete Directory 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Although We created the connection Manager before, Just to show you the steps, We are selecting <New Connection..>.
Delete Directory Using File System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are deleting directory so we are selecting Existing Directory option from the Usage Type 
Delete Directory Using File System Task in SSIS 4
Click on the Browse button to select the Existing Folder.
Delete Directory Using File System Task in SSIS 5
From the above the above screenshot you can observe that, We selected the SSIS BLOGGER pics folder inside the File System Task Folder
Delete Directory Using File System Task in SSIS 6
Click Ok to finish configuring the File Connection Manager.
Delete Directory Using File System Task in SSIS 7
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully deleted the Directory using the File System Task or Not.
Delete Directory Using File System Task in SSIS 8
Well, We successfully deleted the SSIS blogger pics directory present in the File System Task Folder or Directory.
Delete Directory Using File System Task in SSIS 9
Thank You for Visiting Our Blog.



Delete File Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to delete File Using SSIS File System Task with example. To delete Directory, Please refer Delete Directory Using File System Task in SSIS article.
TIP: To Delete Multiple files we have to use the For each container.
We have File System Task Folder inside the Music Folder. Below screenshot shows you the data inside that folder. Our task is to delete single file (COUNTRIES LOOKUP.xls) present inside the File System Task Folder.
Delete File Using File System Task in SSIS 2014
Drag and drop the File System Task into the Control Flow region and rename it as Delete File Using File System Task in SSIS
Delete 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 deleting Single file so, Please change the operation property toDelete File as shown in the below screenshot
Delete 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.
Delete File Using File System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are deleting single file so we are selecting Existing File option from the Usage Type 
Click on the Browse button to select the Existing File (which is Countries Lookup.xls).
Delete File Using File System Task in SSIS 4
From the above the above screenshot you can observe that, We selected the Excel file called Countries Lookup inside the File System Task Folder
Delete File Using File System Task in SSIS 5
Click Ok to finish configuring the File Connection Manager.
Delete File Using File System Task in SSIS 6
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully deleted the excel file using the File System Task or Not.
Delete File Using File System Task in SSIS 7
Well, We successfully deleted the Countries Lookup file present in the File System Task Folder or Directory.
Delete File Using File System Task in SSIS 8
Thank You for Visiting Our Blog.




Move Directory Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to Move Directory from one location to another location Using SSIS File System Task with example. To delete the complete Directory, Please refer Delete Directory Using File System Task in SSIS article.
We have File System Task Folder inside the MSBI Folder. Below screenshot shows you the data inside that folder. Our task is to move the SSIS Blogger pics folder inside the File System Task Folder to Copied Folder inside F Drive.
Move Directory Using FIle System Task in SSIS
Files inside the Copied folder are:
Move Directory Using FIle System Task in SSIS
Drag and drop the File System Task into the Control Flow region and rename it as Move Directory Using File System Task
Move Directory 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 Moving directory so, Please change the operation property to Move Directory as shown in the below screenshot
Move Directory 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.
Move Directory Using FIle System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are Moving existing directory so we are selecting Existing Folder option from the Usage Type 
Move Directory Using FIle System Task in SSIS 4
Click on the Browse button to select the Existing Folder.
Move Directory Using FIle System Task in SSIS 5
From the above screenshot you can observe that, We selected the SSIS BLOGGER pics folder inside the File System Task Folder
Move Directory Using FIle System Task in SSIS 6
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..>.
Move Directory Using FIle System Task in SSIS 7
From the above the above screenshot you can observe that, We created New folder called SSIS BLOGGER pics folder inside the Copied Folder by clicking the Make New Folder button.
Move Directory Using FIle System Task in SSIS 8
Click Ok to finish configuring the File Connection Manager for the destination.
Move Directory Using FIle System Task in SSIS 9
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully Moved the Directory using the File System Task or Not.
Move Directory Using FIle System Task in SSIS 10
Well, We successfully Moved the SSIS blogger pics directory present in the File System Task Folder to the Copied Folder Directory.
Move Directory Using FIle System Task in SSIS 11
If you observe the source connection again (MSBI Folder), SSIS blogger pics folder is not present because we are moving the directory not coping it.
Move Directory Using FIle System Task in SSIS 12
Thank You for Visiting Our Blog.




Move File Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to Move File from one location to another location Using SSIS File System Task with example. To Move the complete Directory, Please refer Move Directory Using File System Task in SSIS article.
TIP: Please use the For each Container to move multiple files from one location to another location.
We have File System Task Folder inside the MSBI Folder. Below screenshot shows you the data inside that folder. Our task is to move the CUSTOMERS.txt file inside the File System Task Folder to Copied Folder inside F Drive.
Move File Using FIle System Task in SSIS
Files inside the Copied folder are:
SSIS File System Task Destination Folder 1
Drag and drop the File System Task into the Control Flow region and rename it as Move File Using File System Task in SSIS
Move Files 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 Moving single file so, Please change the operation property to Move File as shown in the below screenshot
Move Files 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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Here, We haven’t created any connection Manager before so, We are selecting <New Connection..>.
Move Files Using File System Task in SSIS 3
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. In this example we are Moving existing file so we are selecting Existing File option from the Usage Type.
Click on the Browse button to select the Existing File from the file system.
Move File Using File System Task in SSIS 4
From the above screenshot you can observe that, We selected the CUSTOMERS.tx file inside the File System Task Folder
Move 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..>.
Move Files Using File System Task in SSIS 6
In this example we are Moving existing file to the already existing folder so, we are selecting Existing Folder option from the Usage Type.
Move Files Using File System Task in SSIS 7
Click on the Browse button to select the Existing Folder from the file system.
Move Files Using File System Task in SSIS 8
From the above the above screenshot you can observe that, We selected the Copied Folder as the destination folder. Click Ok button to select it.
Move Files Using File System Task in SSIS 9
Click Ok to finish configuring the File Connection Manager for the destination.
Move Files Using File System Task in SSIS 10
Click Ok to finish configuring File System Task Editor. Let’s run and see whether we successfully Moved the Customers.txt file using the File System Task or Not.
Move Files Using File System Task in SSIS 11
Well, We successfully Moved the Customers.txt file present in the File System Task Folder to the Copied Folder.
Move Files Using File System Task in SSIS 12
Thank You for Visiting Our Blog.




Rename File Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to Rename File Using SSIS File System Task with example. To Move the file, Please refer Move File Using File System Task in SSIS article.
We have File System Task Folder inside the MSBI Folder. Below screenshot shows you the data inside that 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
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, Please change the operation property to Rename File as shown in the below screenshot
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 theIsSourcePathVariable 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..> option, File Connection Manager Editor will be opened to configure it. In this example we are Renaming the existing file so we are selecting 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 the above screenshot you can observe that, We created the New text file called as NewGeography.txt inside the Copied Folder. Click 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
Click Ok to finish configuring File System Task Editor. 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
Thank You for Visiting Our Blog.



Setting Attributes Using File System Task in SSIS 2014


In SQL Server Integration Services, File System Task allows us to perform Ten types of Operations on Files and Folders. In this article We will show you, How to Set the Attributes for files and folders in the File system Using SSIS File System Task with example. To delete the Directory Content, Please refer Delete Directory Content Using File System Task in SSISarticle.
We have Copied Folder inside the Documents Drive (F). Below screenshot shows you the data inside that folder. Our task is to change the default attributes of the CUSTOMERS.txt File using this File System Task
Setting Attributes Using File System Task SSIS 0
Before creating the package, Let us show you the default attributes of the Customers.txt file
Setting Attributes Using File System Task SSIS 1
Drag and drop the File System Task into the Control Flow region and rename it as Set Attributes Using File System Task in SSIS
Setting Attributes Using File System Task SSIS 2
Double click on it will open the File System Task Editor to configure it.
In this example, We are changing the attributes of a single file so, Please change theoperation property to Set Attributes as shown in the below screenshot
Setting Attributes Using File System Task SSIS 3
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 theIsSourcePathVariable property to TRUE and select the Variable Name.
Although We created the connection Manager before, Just to show you the steps, We are selecting <New Connection..>.
Setting Attributes Using File System Task SSIS 4
Once you click on the <New Connection..> option, File Connection Manager Editor will be opened to configure it. Please select the file you wish to alter the attributes.
In this example we are altering the customers text file so we are selecting Existing File option from the Usage Type and Click on the Browse button to select the File.
Setting Attributes Using File System Task SSIS 5
From the above the above screenshot you can observe that, We selected the customers text file inside the Copied Folder.
Setting Attributes Using File System Task SSIS 6
Click Ok to finish configuring the File Connection Manager.
Let us change the Hidden Property of a text file to True. This will hide the text file
Setting Attributes Using File System Task SSIS 7
Let us change the ReadOnly Property of a text file to True. This will not allow us to alter the text file
Setting Attributes Using File System Task SSIS 8
Click Ok to finish configuring File System Task Editor.
Setting Attributes Using File System Task SSIS 9
Let’s run and see whether we successfully changed the attributes of a given file using the File System Task or Not.
Setting Attributes Using File System Task SSIS 10
Well, We successfully changed the attributes
Setting Attributes Using File System Task SSIS 11
Thank You for Visiting Our Blog.



File System Task

Using this task, we can perform different operations at File level.
this includes

--> Copy a directory
--> Copy a file
--> Create a directory
--> Delete a directory
--> Delete the contents of a directory
--> Delete a file
--> Move a directory
--> Move a file
--> Rename a file
--> Set the attributes of a directory or file

EXAMPLE

- Using ForEach Loop container, we will copy all the files from source to destination
- Create one variable to store current file name
- Set following properties for ForEach Loop Container

- further properties of For Each Loop Container


- File System Task properties


- Make sure to choose proper Destination Connection like this


- Make sure to choose "copy file" operation
- Make sure to choose TRUE in IsSourcePathVariable and choose Currentfile in SourceVariable.



SSIS File System Task

Introduction

In this article I am trying to discuss about a beautiful and widely used task in SSIS control flow and it is called the File System Task. Most of the SSIS developer prefers these tasks to work with file systems.  So I decide to put it in my article list.

What the use of File System Task
As the name suggest the file system tasks is used to work with file system such as Copy or Move file from one location to another, Delete files and directories, Rename etc. It can work with attributes like hidden, archive, read-only etc.

To perform this type of operation on source and destination it needs file connection manager configuration or a variable that contain the respective path.

Limitation of File System Task
With lot of facilities provided by File System Task, it has certain limitation that we must understand. The File system tasks can only open a single file or directories. Therefore it cannot be used with multiple file or directories.

Don't worry; there is a solution for that. To do so we have to put the File System Task into Foreach Loop Containers.

Operation by File System Tasks

Here is a list of predefine operation that can be performed by File System Task.

Operation
Description
COPY
Directory
To copy a folder from one location to other.
File
Copies a file from one location to other.
DELETE
Directory
To delete a folder in a specific location.
File
Deletes a file in a specific location.
MOVE
Directory
To move a folder from one location to other.
File
Moves a file from one location to other.
RENAME
File
Renames a file in a specified location.
CREATE
Directory
Creates a folder in a specified directory.
SET ATTRIBUTES
Files or Folder
Attributes of a file or folder includes Normal, Hidden, Read-only.

Example of File System Task

Step-1 [ Create a Package level Variable ]

We care a package level variable first which contain the source path.



Variable Name: v_SourcePath
Data Type        : String
Scope               : Package Level
Value                 : F:\Practice_SQL\SSIS\FileSystemTask\SourceFolder\SourceFile.txt

Please Note that the File name is very important here with Path of the folder others we got an error.



Step-2 [ Drag the File System Task to Control Flow pan ]

Now we are configuring the file system task editor.







Step-3 [ Run the Package and Analyze the Output ]







Hope you like it.