Configuring a job to deliver email on success of the job

  • good afternoon guys,

    i would like to know how to configure a job to deliver an email on the success of that job. Thanks

  • Go to the "Notifications" section of the job, and the email options are there.

  • go to job --> properties -->notifications--> choose email and the option ' when the job succeeds'

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Thanks, how would i configure the email option because all i see is a check box and choice of sending an email on success or failure

  • thanks there is a an option for email but there is no option for you to input the email address to where the notification needs to be sent, could you throw more light thanks i appreciate it

  • @ klineandking

    go to operator --> make a new operator

    write the email name there and name the operator.

    Then, when you go to job --> properties --> notifications, you can see the operator you created that name...and the mail will be send to those email you configured.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • If you want to send the email to multiple people, your best bet is to create an email group/distribution list in Outlook and set that as the address.

    If you want to send it to multiple addresses for the same person, you can enter multiple addresses in the Operator's Email Name field and separate them with a semicolon.

    eg. sample@yahoo.com; sample.gmail.com

    --------------------------------------
    When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
    --------------------------------------
    It’s unpleasantly like being drunk.
    What’s so unpleasant about being drunk?
    You ask a glass of water. -- Douglas Adams

  • OR

    You can create 2 T-SQL job steps -- one for sending Success Email and another for sending failure email and then type the following T-SQL in thoses steps--

    EXEC sp_send_dbmail @profile_name='DBMAIL_Profile',

    @recipients='abc@domain.com;def@domain.com',

    @subject='Subject text',

    @body='Body of the message'

    -- Please note that this requires DBMail feature to be enabled.

    And then for the previous job steps you set them such that on Success the control should go to Success Email step and on Failure

    the control should go to Failure Email step.

    Thank You,

    Best Regards,

    SQLBuddy

Viewing 8 posts - 1 through 7 (of 7 total)

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