Database Maintenance Tasks in SSIS

Tools for keeping your SQL indexes in check.

Do you have a large data import that leaves your indexes less than perfect? Do you want to backup your current database before you run a purge package? You are in luck; SSIS contains a handful of database maintenance tasks for these and other special occasions. If you have worked with database maintenance plans in SQL Server 2005 or SQL Server 2008, then you are already familiar with what can be done in SSIS. You may or may not know that maintenance plans are just SSIS packages that you built with a different tool. So why is this all important? Well, as I stated earlier, when you do things to your data, you will change the state of index fragmentation and if you are deleting or updating data, you could potentially lose information. By using the maintenance plans tasks in SSIS you can build in backup, reindexing, and other maintenance processes to your package. The best thing about this is that they will run in the bounds of your control flow so you won't have to do try and guess at scheduling as you would if you were trying to coordinate SQL Agent Jobs. Most of the tasks are very self explanatory but here is a complete list anyway.

  • Back Up Database - Performs database backups
  • Execute SQL Server Agent Job – Starts a SQL Server Agent job
  • Check Database Integrity – Runs DBCC CHECKDB to verify database integrity
  • Execute T-SQL Statement – Run provided T-SQL against a SQL Server.
  • History Cleanup -  Cleans up history in MSDB including backup history, maintenance plan history and job history
  • Maintenance Cleanup – Cleans up backup files or maintenance plans text reports
  • Notify Operator – Sends a notification to a SQL Operator
  • Rebuild Index – Rebuilds one or more indexes
  • Reorganize Index – Reorganizes one or more indexes
  • Shrink Database – Use to shrink a file or files in a database
  • Update Statistics – Updates database statistics

About the Author

Eric Johnson, SQL Server MVP, is the owner of Consortio Services in Colorado Springs providing IT systems management and technology consulting. He is also the President of the Colorado Springs SQL Server User Group. He can be contacted at


  • Hyper-V Architecture: Some Clarifications

    Brien answers two thought-provoking reader questions. First, do Hyper-V VMs have direct hardware access? And second, how is it possible to monitor VM resource consumption from the host operating system?

  • Old Stone Wall Graphic

    Microsoft Addressing 36 Vulnerabilities in December Security Patch Release

    Microsoft on Tuesday delivered its December bundle of security patches, which affect Windows, Internet Explorer, Office, Skype for Business, SQL Server and Visual Studio.

  • Microsoft Nudging Out Classic SharePoint Blogs

    So-called "classic" blogs used by SharePoint Online subscribers are on their way toward "retirement," according to Dec. 4 Microsoft Message Center post.

  • Datacenters in Space: OrbitsEdge Partners with HPE

    A Florida-based startup is partnering with Hewlett Packard Enterprise in a deal that gives new meaning to the "edge" in edge computing.

comments powered by Disqus

Office 365 Watch

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.