Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Need to update SQL job notification operator

Author  Topic 

AnitaDBA2010
Starting Member

18 Posts

Posted - 2011-01-28 : 14:51:33
Hi All-

Could anyone guide me how to change/update the current SQL agent job notification operator ?

The current value for the notifications is selected to E-mail domain\abc when job fails and i need to update it domain\xyz

i tried executing below command but i received the error msg as below

sp_update_job @job_name ='perfdata' @notify_email_operator_name = 'domain\xyz'

Msg 14234, Level 16, State 1, Procedure sp_verify_job, Line 243
The specified '@notify_email_operator_name' is invalid (valid values are returned by sp_help_operator).

Thanks
Anita

Anita

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-28 : 15:15:31
You need to add it as an operator first.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

AnitaDBA2010
Starting Member

18 Posts

Posted - 2011-01-28 : 15:23:46
Thank you Tara, you are correct :). i found below query which worked perfectly and i was able to add the operator

USE [msdb]
GO

EXEC msdb.dbo.sp_add_operator @name=N'TheNewOne',
@enabled=1,
.....
@email_address=N'theaddress@the.rest',
@category_name=N'[Uncategorized]'
GO
execute sp_update_job @job_name=N'yourjob', @notify_email_operator_name=N'TheNewOne';


Thanks
Anita

quote:
Originally posted by tkizer

You need to add it as an operator first.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Anita
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-28 : 15:31:59
You're welcome, glad to help.

The error message is how I knew it was missing.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -