Thursday, January 10, 2013

Enable SQL Job notifications for all Jobs in single shot


Please execut the below script on MSDB database .... :)

declare @sql nvarchar(max) = '';

select
@sql += N'exec msdb.dbo.sp_update_job @job_name = ''' + name + N''',
@notify_level_email=2,
@notify_level_netsend=2,
@notify_level_page=2,
@notify_email_operator_name=N''NMS_Alerts''
' from msdb.dbo.sysjobs
order by name;

print @sql;

exec (@sql);