Want to get 'Failed' word in subject line of email, when job fails

Posted on 2007-08-01
Last Modified: 2010-03-19
Hi DB Experts,

I am sending mail notification when some job fails, it is by the way of notification operators.

My first problem is i can not register multiple operators for mail notification, i have to create mail alias for that.

Second problem is when the mail notification is sent even if the job is failing in subject line i am getting job completed messege, so i want to customize the subject line and need to have the word 'failed' in subject line, i dont want to do this by sp_send_dbmail option.

Pls. let me know, its urgent.

Tejas Shah

Question by:TejasShahEE
    LVL 14

    Accepted Solution

    afaik you can't change what sql agent puts in the subject of the emails it sends
    LVL 19

    Assisted Solution

    You can send email by using this SP:

    Add 2 more steps to your job, let's say "On Failure"  and "On Success".
    Then edit your "original" job step. Set "On success action" to "Go to step On Success", "On failure action" to "Go to step On Failure"

    Author Comment

    Hi rimvis,

    Your both the suggested ways are programmatic approach, i want to do this by configuring something if possible in sql-2k5.
    I did not want to make use of sp_send_dbmail just because it is a programmatic approach!
    Let me know only if there are some configuration settings.

    Tejas Shah
    LVL 14

    Expert Comment

    Well, not really. I don't believe it can be done the way you want to do it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now