question

fantumahi2 avatar image
fantumahi2 asked

how to delete old flat file in ssis

I have old flat file from 2009 that are on my drive for long years. i want to create SSIS package to delete all of them except the last three months. i want my package to count from today and do calculate three months back and delete them all. So is there any one who can help me how am going to create the package? thank you
ssistruncate
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image
JohnM answered
The easiest/quickest way is probably with a Script Task. Here are some references: http://social.msdn.microsoft.com/Forums/en-US/449edab3-ec20-4e37-a257-5e4dfce878df/delete-files-older-than-3-days-using-ssis-tasks?forum=sqlintegrationservices http://www.mssqltips.com/sqlservertip/2930/sql-server-integration-services-package-to-delete-files-from-a-network-or-local-path-based-on-date/ There might be a way to make it work with a Foreach Loop Container but I'm not sure about how to accomplish that Hope this helps!
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Great idea, @JohnM @fantumahi2 you might also be able to accomplish this task in a smaller scale using "File System Task". Either Way, I'd try using @JohnM suggestion first!
1 Like 1 ·
fantumahi2 avatar image
fantumahi2 answered
Thank you .. it was helpfull
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fantumahi2 avatar image
fantumahi2 answered
Thank you so much
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.