I have a Job setup in SQL Server 2008 which sends a notification email to one operator when the job fails.
Question: Is it possible to setup a notification email being sent to multiple operators for that specific job?
I believe a possible workaround for this is to create lots of alerts for the database for each given severity but I was hoping that there was a more concise way to do this. If I were to go this route, what severity errors would likely be triggered from a failed job? (I don't think I would require all 25 for something like that)
Can this be done through sql command to add more operators to notify on failure? Through the UI you are only able to choose a single operator it seems.
To open the Job Activity Monitor, expand SQL Server Agent in Management Studio Object Explorer, right-click Job Activity Monitor, and click View Job Activity. You can also view job activity for the current session by using the stored procedure sp_help_jobactivity.
Select all the jobs you want to script (press the Ctrl button while clicking to select individual jobs) and then right click and select the scripting option you want. This will then create all the selected jobs as a single query.
To view these logs, perform the following steps: Open SQL Server Management Studio (SSMS) and connect to the corresponding database instance. Navigate to Management -> SQL Server Logs -> SQL job name. Find the job failure event and review the log details.
Question: Is it possible to setup a notification email being sent to multiple operators for that specific job?
I don't believe this is possible.
Certainly looking at the structure of [msdb].[dbo].[sysjobs]
the various operator_id
columns are in this table itself which would support the idea that 1 to many is not possible.
But some alternatives
sysoperators
this is good for strings that can fit in nvarchar(100)
If the intention is that multiple people in your organization should be notified if a job fails, you can change the email address of the operator to include multiple mailboxes by separating each mailbox with a semicolon.
I'm assuming your notified operator is called JobWatcher:
EXECUTE msdb.dbo.sp_update_operator @name = N'JobWatcher', @email_address = N'[email protected];[email protected]';
Now [email protected] and [email protected] will receive mail when the job fails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With