Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Delete old files (SSIS or DOS)

Author  Topic 

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-10-09 : 12:19:50
I've been tasked with coming up with a process to delete old files out of a certain directory. It's prefered to have a configuration file to go in and be able to change the number of days to retain files (7 for delete files older than 7 days for example). I've been told I can do this with SSIS. Can anybody point me in the right direction to do this in SSIS or even in DOS? I don't know ActiveX scripting if that's what's needed in SSIS. I prefer doing something like this in DOS but not sure it's possible to automate. Any help is appreciated.

Van

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-10-09 : 13:11:42
You can use the code in my backup stored procedure. It allows for the deletion of files based upon an inputted number of days to retain. It's heavily commented, so you should be able to figure out which part you need.

http://weblogs.sqlteam.com/tarad/archive/2007/02/26/60120.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-10-09 : 13:28:55
Thanks. That works.
Go to Top of Page
   

- Advertisement -