Graphic tutorial of sending email notification when SQL Server job runs successfully or fails

Time:2019-11-20

The settings of SQL Server 2005 are as follows:
1. Run SQL Server surface area configuration – > surface area configuration for features – > select Database Mail – > enable database mail stored procedures
2. Open SQL Management Studio > Management > Database Mail > configure SMTP settings
3. Open SQL Server Agent – > operators – > create a new operator
4. Create a new job – > in notifications, select email and the operator you just created – > send email when the job fails / succeeds / completes.
5. Finally, don’t forget to restart SQL agent

SQL Server 2008 is the same as 2005, but there is no first step.

I’m afraid that the above brief description is still difficult for beginners to operate. Take SQL Server 2008 as an example, and the figure shows.
1. Open SQL Management Studio > Management > Database Mail > configure SMTP settings
If the configuration is the first time, each of the following steps will appear. If the corresponding options have been configured before, the following steps will not all appear.
1-1

 1-2    

1-3

1-4

1-5

1-6

1-7

After the database email is configured, send a test mail to test whether the SMTP settings are correct

1-7

2. Open SQL Server Agent – > operators – > create a new operator
2-1

2-2

3. Create a new job – > in notifications, select email and the operator you just created – > select when the job fails / succeeds / completes
Since this section is not a special job tutorial, how to create a job will not be attached in this article. The figure of setting up an operator is attached below

3-1

Finally, don’t forget to restart the job agent

4-1 
If you need to reprint, please indicate that this article was originally written from CSDN tjvctor column:http://blog.csdn.net/tjvictor

Recommended Today

020_CSS3

catalog How to learn CSS What is CSS History of development quick get start Advantages of CSS Three ways to import CSS Expansion: two ways of writing external style selector Basic selector Hierarchy selector Structure pseudo class selector attribute selectors Beautify web page elements Why beautify web pages Span label: for the text that needs […]