Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
SSIS Integration Runtime in Azure Data Factory
The Maintenance Cleanup task removes files related to maintenance plans, including database backup files and reports created by maintenance plans. For more information, see Maintenance Plans and Back Up and Restore of SQL Server Databases.
By using the Maintenance Cleanup task, a package can remove the backup files or maintenance plan reports on the specified server. The Maintenance Cleanup task includes an option to remove a specific file or remove a group of files in a folder. Optionally you can specify the extension of the files to delete.
When you configure the Maintenance Cleanup task to remove backup files, the default file name extension is BAK. For report files, the default file name extension is TXT. You can update the extensions to suit your needs; the only limitation is that extensions must be less than 256 characters long.
Typically, you want to remove old files that are no longer needed, and the Maintenance Cleanup task can be configured to delete files that have reached a specified age. For example, the task can be configured to delete files that are older than four weeks. You can specify the age of files to delete by using days, weeks, months, or years. If you do not specify the minimum age of files to delete, all files of the specified type are deleted.
In contrast to earlier versions of the Maintenance Cleanup task, the SQL Server version of the task does not automatically delete files in the subdirectories of the specified directory. This constraint reduces the surface area of any attack that could exploit the functionality of the Maintenance Cleanup task to delete files maliciously. To delete the first-level subfolders, you must explicitly elect to do this by checking the Include first-level subfolders option in the Maintenance Cleanup Task dialog box.
You can set properties through SSIS Designer. This task is in the Maintenance Plan Tasks section of the Toolbox in SSIS Designer.
For more information about the properties that you can set in SSIS Designer, click the following topic:
For details about how to set these properties in SSIS Designer, see Set the Properties of a Task or Container.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Certification
Microsoft Certified: Azure Database Administrator Associate - Certifications
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.
Documentation
Maintenance Cleanup Task (Maintenance Plan) - SQL Server
Learn how to remove old files for maintenance plans, including text reports for maintenance plans and database backup files using the Maintenance Cleanup Task.
Maintenance Plan (Design Tab) - SQL Server
Maintenance Plan (Design Tab)
Execute T-SQL Statement Task (Maintenance Plan) - SQL Server
Execute T-SQL Statement Task (Maintenance Plan)