Id like to make sure all my agent jobs update the event log if they error.
If i go to the GUI and change the notification area and script it i get:
EXEC msdb.dbo.sp_update_job @job_id=N'7be0b2e1-4404-4fb0-9b93-94a82f31ac5a',
EXEC msdb.dbo.sp_attach_schedule @job_id=N'7be0b2e1-4404-4fb0-9b93-94a82f31ac5a',@schedule_id=8
So i thought i would have to do a cursor to loop though my agent jobs in msdb.
looking at the msdb tables.. to find which jobs need to enabled and which i dont.. I decided to go with the SET approach and decided to try a much easier route of
SET notify_level_eventlog = 2
WHERE notify_level_eventlog = 0
I didnt think you could update system tables.. but this worked.. and looking though my agent jobs in the GUI, they are all now ticked for event log..
Have a done something quite silly and other things needed to be changed for this to work properly.. Or have i found a much simpler solution!