Can't modify the email's subject

  • I want to send emails to my users with 2 different email subjects :

    If the SQL Agent Job fail, the email subject will be : Fail - xxxxx

    If the SQL Agent Job success, the subject will be : Success - xxxx

    But I found SQL Server will only give me a subject :

    SQL Server Job System: 'Daily Full Backup.Subplan_1' completed on \\a machine name

    Is it possible to modify this email subject ?

    Or can I enter whatever I want ? Just like :

    EXEC msdb.dbo.sp_notify_operator

    @subject = N'Fail - xxx SQL Backup',

    @name = N'IT_SQL_Operator',

    @body = N'Fail - xxx SQL Backup'

  • Your example is a backup task: you could generate a different email on Success | Failure of the Back Up Database task using alternative Execute T-SQL Statement tasks that send the email, with whatever Subject and Body you specify.

Viewing 2 posts - 1 through 1 (of 1 total)

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