![]() |
|

Identify and resolve SQL Server problems before they happen
|
|
By: David Bird | Read Comments (9) | Related Tips: More > Monitoring |
Problem
Setting up an alert to e-mail an operator with a message is a multiple step process. You can setup database mail, define an operator and an alert, but still no e-mail is being sent. So how do you send an alert to an operator?
Solution
Note: This solution involves restarting SQL Agent.
Database Mail
First setup database mail with a profile named SQLAlerts. The profile can be named anything but in these instructions, the profile name SQLAlerts is referenced. If you wish to use a different profile name just substitute accordingly. For procedures in setting up database mail, see this post.
Define Operator
Connect to the instance using Microsoft SQL Management Studio
Double Click SQL Server Agent
Right Click on Operators and select New Operator
Specify an operator Name, E-mail name, and click OK
Setup SQL Agent Settings
Note: This step is often overlooked when creating an alert for the first time. SQL Agent must be setup correctly for operators to receive an alert e-mail.
Right Click SQL Server Agent > select Properties
Select Alert System in the left pane
Restart SQL Agent to activate settings.
Warning: Restarting SQL Agent will cancel any executing jobs.
Define Alert
This sample alert will send an email when TEMPDB database gets larger than 0 KB. This setting is set zero so the alert can be tested. Once verified, you will need to update its settings to a reasonable amount or disable it.
Right Click Alerts and select New Alert
On the General pane specify
Click Response in left pane
Click Options in left pane
Click OK
Verify Alert is Working
The operator should receive an e-mail if not see the troubleshooting section.
Open the Alert. Click History in the left pane.
The fields are updated when the alert is triggered.
Stop the Test
To stop the Alert from being sent every two minutes, you have two options disable the alert or provide a more appropriate size and response times.
To disable alert
To change the settings
Troubleshooting
If the operator does not receive an e-mail
Next Steps
| Thursday, June 19, 2008 - 10:15:16 AM - sm8680 | Read The Tip |
|
Hi does anyone know how to alert for when a job gets disabled? Please advise. Thanks Steve |
|
| Wednesday, August 12, 2009 - 1:32:25 PM - dguillory | Read The Tip |
| Monday, April 16, 2012 - 6:08:46 PM - carlos | Read The Tip |
|
Good article, thanks. I have a job with notifications when it fails. When the job fails, I receive an email, but it only says: JOB RUN: 'test1' was run on 4/16/2012 at 10:35:00 AM How more detail about the error could be sent by email? Thanks in advance. |
|
| Thursday, June 07, 2012 - 4:29:59 AM - Bharath | Read The Tip |
|
Can we have a multiple email ids configured as one operator? If so, what is the delimiter between the emails ids? |
|
| Friday, June 22, 2012 - 7:14:34 AM - Reuben Sultana | Read The Tip |
|
@carlos You might want to refer to the following article: SQL Server Diaries: Send SQL Server Agent Job log file by Email
@Bharath The delimiter is a semi-colon (;) but the length is limited to 256 characters.
Reuben |
|
| Monday, December 17, 2012 - 2:08:19 PM - Matthew | Read The Tip |
|
Thank you David. Excellent guide and still relevent in 2012! Cheers! :) |
|
| Wednesday, January 02, 2013 - 1:22:02 PM - Jodi | Read The Tip |
|
I have gone through the steps to set up the operator, but when I go to the SQL Server Agent properties and go to the Alert System page, I enable the maile profile, select Database Mail, but then the profile I created is not listed. I have tried restarting and it doesn't change anything. What do I need to do to fix this? |
|
| Tuesday, February 05, 2013 - 5:58:59 PM - Salman | Read The Tip |
|
Good one. But if I have to modify the text (body/subject). How can I do that. Thanks |
|
| Wednesday, May 15, 2013 - 10:47:12 AM - Paul | Read The Tip |
|
I have all of this working with the Alerts but when a Maintenance Plan runs it will not send out an email. |
|
|
privacy | disclaimer | copyright | advertise | about authors | contribute | feedback | giveaways | user groups Some names and products listed are the registered trademarks of their respective owners. Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com |