0

I have a job that sends an email to an operator (which contains a list of emails within it) upon complexion.

Some of these people that are on that list are the developers who build everything in that job.

I am the DBA but I am also in the list.

enter image description here

QUESTION:

Is there a way to make this job send an email to those guys upon complexion, and to the DBAs only if the job fails?

So, upon complexion of the job, which has 4 steps, the developers will always get an email, (the job is scheduled to run every day), and if (by any reason) the job fails, the developers AND the DBAs will get and email.

2

What you can do is, add a job step called for example mail dba.

In that job step you put the msdb.dbo.sp_send_dbmail

An example job step

EXEC msdb.dbo.sp_send_dbmail  
    @profile_name = 'DBA',  
    @recipients = 'some_email@somedomain.com',  
    @body = 'The Job Failed.',  
    @subject = 'Automated Error Message' ; 

Then you edit every step of the job to go to job step mail dba when it fails.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.