Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Towards the innovative SQL ideas
Browse by Tags · View All
ms sql server 97
ms sql 93
sql server 89
sql 88
database 75
#SQL Server 75
tsql 65
#sql 62
t-sql 59
sql server general 56

Archive · View All
April 2011 14
July 2011 12
May 2011 12
August 2011 11
June 2011 10
September 2011 8
December 2011 6
November 2011 6
February 2012 5
April 2012 4

SSIS - Delete files from specified folder using File System Task in SQL Server

Dec 23 2011 7:51AM by Paresh Prajapati   

We know all the various methods to delete the particular or all files from the specified folder using some of the methods like xp_delete_fileOle Automation Procedures and with xp_cmdshell command line utility which we used for the old files archive or cleanup purpose.

Here i am going to share some of the screens which delete the files with SSIS using File System Task. Let me share them one by one.

1. Folder having some test files.










2. Drag and drop Foreach Loop Container and File System Task.  Foreach Loop Container used to get all the files inside that folder one by one and process with File System Task. Open the Foreach Loop Container properties, goto Collection tab and select Foreach File Enumerator as specified in screen below. 

 

3. Select the folder from where need to delete the files. Also apply extension if you need. 


4.For the file assignment need one variable and the values allocated from Foreach Loop Container process. So assign it from variable mapping as per shot taken below. 





















5. Drag File System Task, select Delete File operation and define Source Connection. 




























 6. Finally run package and files will get deleted.  


Hop you liked this post.

Tags: sql, tsql, sql server, ms sql, ms sql server, t-sql, #SQL Server, #sql, database, sql server general, SQL Scripts, SSIS,


Paresh Prajapati
7 · 24% · 5483
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"SSIS - Delete files from specified folder using File System Task in SQL Server" rated 5 out of 5 by 2 readers
SSIS - Delete files from specified folder using File System Task in SQL Server , 5.0 out of 5 based on 2 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising