Ssis Delete Files Older Than 30 Days Average ratng: 3,6/5 4685 votes

How to delete all files older than X days of a specific extension in a specific. Date and based on that delete the 30 days old files. SSIS package since I.

Here's how you can quickly delete files and folders older than however many days you choose. This is based on the date the file was created. In the example below, data more than 50 days old is deleted. At the same time, so are empty folders and files in nested folders. Const strPath = 'D: My Backups' Dim objFSO Set objFSO = CreateObject('Scripting.FileSystemObject') Call Search (strPath) ' Comment out below line if you'd like to use this script in windows schedule task WScript.Echo'Done.'

Sub Search(str) Dim objFolder, objSubFolder, objFile Set objFolder = objFSO.GetFolder(str) For Each objFile In objFolder.Files ' Use DateLastModified for modified date of a file If objFile.DateCreated.

Listing of these RCP does not constitute a formal pricing offer from Intel. If sold in bulk, price represents individual unit. Prices may vary for other package types and shipment quantities, and special promotional arrangements may apply. Intel core 2 quad audio driver.

Ssis Delete File

Hello, I have a maintenance plan in SQL Server 2000 that is not deleting files as it should. No problem as this gives me more experience working with SSIS. However, after writing a script, I find you can't debug a script. Now, I'm not sure if this is the best way to delete old files in SSIS.

I just have one script task on the control flow. It is turning red and not working. I've submitted the code that I am using. I am supply the unc path. I just need it to delete files older than 7 days. I am working on a SQL Server 2008 R2 server in SQL Server BI studio. Any help is greatly appreciated.

Delete Files Older Than 30 Days

Tony (The original code example came from: Script: Dim oFSO Dim sDirectoryPath Dim oFolder Dim oFileCollection Dim oFile Dim iDaysOld Dim sDebug As String 'Initilize variable '****************** sDebug = 'Y' 'Server Files '**************** iDaysOld = CInt(Dts.Variables('User: aysBack').Value) 'the variable DaysBack can be altered as needed. MsgBox(iDaysOld) oFSO = CreateObject('Scripting.FileSystemObject') sDirectoryPath = CStr(Dts.Variables('User::FileFolder').Value) 'the variable FileFolder can be as needed. Express invoice 3 87 keygen generator. MsgBox(sDirectoryPath) oFolder = oFSO.GetFolder(sDirectoryPath) oFileCollection = oFolder.Files 'Walk through each file in this folder collection.

Coments are closed
Scroll to top