We can either use SQL Server Management Studio or use Transact-SQL query to find any SQL Agent jobs that have been setup without notification operator.
The following are the steps to find SQL Agent jobs without notification operator via SQL Server Management Studio:
- In Object Explorer, expand SQL Agent, then expand Jobs folder (see below):
- Next, right-click any SQL Agent Job and choose Properties and then click Notifications (see below):
This is a good idea only if we have a small number of SQL Agent Jobs on SQL Server. However, most production systems literally contain hundreds of SQL Agent Jobs, and it is quite difficult to find this information like that. In this situation, you might use the following Transact-SQL query, which I’ve written a while ago to find SQL Agent Jobs without notification operator:
USE [msdb] GO SET NOCOUNT ON; SELECT 'SQL Agent job(s) without notification operator found:' AS [Message] SELECT j.[name] AS [JobName] FROM [dbo].[sysjobs] j LEFT JOIN [dbo].[sysoperators] o ON (j.[notify_email_operator_id] = o.[id]) WHERE j.[enabled] = 1 AND j.[notify_level_email] NOT IN (1, 2, 3) GO
I hope you will find this information useful 😉
Thank you for the T-sql query. I found it very helpful since inheriting a new system and getting notified that a job failed from the end user on jobs I did not know even existed since they don’t bother to tell you when they create jobs.
LikeLike
I actually needed to see where the notification is checked because we no longer need the agent alerts with the centralized monitoring solution and your code helped get me started, thanks!
LikeLike