Although we can use job logs to check whether SQL Server Job runs successfully or fails, manual queries are neither timely nor intelligent. The following describes how to set mail notifications for SQL Server to automatically send status emails after the job is completed.
The SQL Server 2005 settings are as follows:
1. run SQL Server surface area configuration-> surface area configuration for features-> select database mail-> select enable database mail stored procedures
2. Choose SQL management studio> Management> database mail> Configure SMTP settings.
3. enable SQL Server Agent> operators> to create a new operator.
4. Create a new job-> in notifications, select email and the newly created operator-> select to send an email when the job fails, succeeds, or completes.
5. Finally, do not forget to restart the SQL Agent.
The setting of SQL Server 2008 is the same as that of SQL Server 2005, but there is no first step.
The above brief description is difficult for beginners. The following uses SQL Server 2008 as an example.
1. Choose SQL management studio> Management> database mail> Configure SMTP settings.
If this is the first configuration, each of the following steps will appear. If the corresponding options have been configured before, the following steps will not all appear.
After configuring the database email, send a test mail to test whether the SMTP settings are correct.
2. Choose SQL Server Agent> operators> Create a new operator.
3. Create a new job-> in notifications, select email and the newly created operator-> when the job fails, succeeds, or completes
Since this section is not a tutorial on specialized jobs, how to create a job is not shown in this document. The following figure shows how to set operator.
Never forget to restart the job agent.
If you need to reprint, please indicate the original from csdn tjvictor column: http://blog.csdn.net/tjvictor