SQL Server Integration Services (SSIS) – Part 13 – Backup Database task in SSIS and Send Mail

Karthikanbarasan
Posted by in Sql Server category on for Intermediate level | Points: 250 | Views : 20183 red flag
Rating: 5 out of 5  
 2 vote(s)

This is part 13 of the series of article on SSIS


 Download source code for SQL Server Integration Services (SSIS) – Part 13 – Backup Database task in SSIS and Send Mail

Introduction

In this article we are going to see on how to use a Backup Database task to create an execution plan in SSIS to take a database backup. This task will be very helpful for the DBA’s to maintain the database automatically by creating the package and using it across the servers. This task has many options to do a Full, Differential backups based on our requirement we can go ahead and use the respective option. Let’s jump into the steps on how to create and use the backup database task 

To follow my series of articles on SSIS packages refer to the below URL’s

SSIS Articles Part 1 to 12

Steps

Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on integration services project. Once the project is created, we will see on how to use Backup Database task options available with SSIS.

Once we are into the project drag and drop the Backup Database Task from the tool box as shown in the below figure


Now drag and drop the Send Mail task, so here our task is to do a backup and send a mail to the DBA that the backup has be done successfully. Once you drag and drop the Send mail task then you project will look like below


Now let’s step into the configuration section of the Backup Database task and do the configuration for a Full backup database. Just double click on the backup database task it will open a window as shown in the below screen. We need to do the configuration as shown below. It’s self-explanatory on the options available


Clicking on the View T-SQL button will open a popup as shown in the below screen


Now configure the Send mail task (Check my previous link on how to configure Send Mail task in SSIS).  Now press F5 to execute the package to make a Full database backup. Once everything is ready and executed your screen will look like below.


Send Mail task shows red color which means there is an error in the task. It’s a known error, since it’s executed in my local system SMTP is not configured.

Conclusion

So in this article we have seen how to back up a database using SSIS package and send a mail to the DBA on success.

Page copy protected against web site content infringement by Copyscape

About the Author

Karthikanbarasan
Full Name: Karthikeyan Anbarasan
Member Level: Silver
Member Status: Member,Moderator,Microsoft_MVP,MVP
Member Since: 1/2/2011 3:00:14 AM
Country: India
Thanks Karthik www.f5Debug.net
www.f5Debug.net
www.f5Debug.net Around 5 years of experience in Microsoft technologies like ASP.Net, VB.Net, C#.net, SQL server, Biztalk Server, WCF, WPF, SSIS, SSRS, SSAS, AJAX and working as Senior Analyst in a US based MNC.

Login to vote for this post.

Comments or Responses

Posted by: SheoNarayan on: 2/28/2011 | Points: 25
Very good effort Karthik. Very well appreciated.

5+ from me.

Keep it up!
Posted by: Karthikanbarasan on: 2/28/2011 | Points: 25
Thanks a lot Sheo!!!

Login to post response

Comment using Facebook(Author doesn't get notification)