How to get "operators" email/s from a procedure

  • I wanted to send some emails using "xp_sendmail" from a stored procedure and I wanted to get the email address/es for this from the "operator" (for ex. "dba_on_call" operator). This I need to do because sometimes we change the operator's emails and I do not want to do hardcoding in the stored procedure otherwise we will have to change the proedure each time we need to change the email.

    One solution that I can think of as an alternate for this is to store these emails in a table but I was just wandering if I can take these from the "operators" (opertor name will be same like "dba_on_call" all the time) because anyway I will have to change the emails for the operator when required.

    Thanks for all the help

     

     

  • I am sorry I think I put this question under "SQL Server 2005 (Yukon)" but actually I wanted to do above thing in "SQL server 2000"

     

     

  • Select id, name, enabled, email_address from dbo.SysOperators

  • Thanks much RGR.

  • HTH, again .

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply