Send Messages from SQL SERVER

  • we have maintenance plan for couple of databases backup jobs..

    I want to get Messages from sql server to my mail when ever job success or failure.

    I don't have idea for configuring this.I shall be thankful if someone tel me how to do ..

  • Is Database Mail configured?

  • first configure database mail

    then create a sql job

    inside job there is an option notifications

    write email id in that ...

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • SKYBVI (12/21/2011)


    first configure database mail

    then create a sql job

    inside job there is an option notifications

    write email id in that ...

    Regards,

    Skybvi

    Those options allow for send mail when job finishes or send mail when job fails, not both.

    The way to get notification when the job finishes and when the job fails is to

    Configure database mail

    In the job, create 2 extra steps, one for when the job succeeds and one for when the job fails.

    In the Advanced section of the original job step, change the on success action to send a mail and change the on failure action to send a mail.

    The T-SQL to send a mail once database mail has been configured is:

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = '',

    @recipients = '',

    @body = '',

    @subject = ''

  • derekr 43208 (12/21/2011)


    SKYBVI (12/21/2011)


    first configure database mail

    then create a sql job

    inside job there is an option notifications

    write email id in that ...

    Regards,

    Skybvi

    Those options allow for send mail when job finishes or send mail when job fails, not both.

    The way to get notification when the job finishes and when the job fails is to

    Configure database mail

    In the job, create 2 extra steps, one for when the job succeeds and one for when the job fails.

    In the Advanced section of the original job step, change the on success action to send a mail and change the on failure action to send a mail.

    The T-SQL to send a mail once database mail has been configured is:

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = '',

    @recipients = '',

    @body = '',

    @subject = ''

    For sending mails for both fail and success you can make a SSIS package .

    That way easy.

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • could you tel me which task/transformation i have to use in SSIS package for send messages from SQL SERVER to mail..

  • Create a operator & then go to job properties->Notification->select email when job succeeds.

  • mahesh.dasoni (12/22/2011)


    Create a operator & then go to job properties->Notification->select email when job succeeds.

    The poster wants to be notified in the event of the job finishing and when it fails, with the job notification, you can have only one - not both.

  • use job completes option which is used for both successful & failed jobs

  • geetha@in (12/22/2011)


    could you tel me which task/transformation i have to use in SSIS package for send messages from SQL SERVER to mail..

    Send mail task

    Regards
    Sushant Kumar
    MCTS,MCP

  • mahesh.dasoni (12/22/2011)


    use job completes option which is used for both successful & failed jobs

    Correct

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

Viewing 11 posts - 1 through 10 (of 10 total)

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