How to Send Email to Multiple Email accounts From SQL Server Agent if Job Fails - DBA Tutorial

In this video you will learn how to send email to multiple recipients (email addresses) if SQL Server Agent Job fails. It demonstrates using couple of methods.
1- Send email to multiple accounts (recipients) using sp_send_dbmail store procedure
2- Send email to multiple accounts (recipients) using configured Operator (SQL Server Agent Operator)


Scripts 1:

--How to send email to multiple email accounts from SQL Server Agent Job if fails_sp_send_dbmail
EXEC msdb.dbo.sp_send_dbmail
--Your profile name
    @profile_name = 'Techbrothers',
 --Your multiple recipients
    @recipients = 'email1@gmail.com;email2@yahoo.com',
    @body = 'Job Failed Please check ASAP',
    @subject = 'Job Failed on Production System' 

Script 2: 
--How to send email to multiple email accounts from SQL Server Agent Job if fails_addOperator
USE [msdb]
GO

/****** Object:  Operator [DBA]    Script Date: 4/13/2015 8:23:14 PM ******/
EXEC msdb.dbo.sp_add_operator @name=N'DBA', 
  @enabled=1, 
  @weekday_pager_start_time=80000, 
  @weekday_pager_end_time=235900, 
  @saturday_pager_start_time=90000, 
  @saturday_pager_end_time=180000, 
  @sunday_pager_start_time=90000, 
  @sunday_pager_end_time=180000, 
  @pager_days=62, 
  @email_address=N'email1@gmail.com;Email2@yahoo.com', 
  @category_name=N'[Uncategorized]'
GO


Script 3:
--How to send email to multiple email accounts from SQL Server Agent Job if fails_updateOperator

  --How to look at Operator information
  select * from sysoperators
--How to update operator to send email to multiple recipients

EXECUTE msdb.dbo.sp_update_operator
  @name = N'DBA',
  @email_address = N'Email1@gmail.com;Email2@gmail.com'



Send Email to Multiple Email accounts From SQL Server Agent if Job Fails - DBA Tutorial

35 comments:

  1. Email checker or atomic email verifier software is all the same, and they go hand to hand with email marketing if you are talking about a large scale. To get the best out of your email marketing, you need to mix those two together to get the best flavours.

    ReplyDelete
  2. I am a new user of this site so here i saw multiple articles and posts posted by this site,I curious more interest in some of them hope you will give more information on this topics in your next articles. hotmail.com

    ReplyDelete
  3. Thanks for picking out the time to discuss this, I feel great about it and love studying more on this topic. It is extremely helpful for me. Thanks for such a valuable help again. saiba como acessar o site www.hotmail.com entrar

    ReplyDelete
  4. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. entrar no hotmail

    ReplyDelete
  5. If you've got ever cursed your fax machine for its numerous paper jams or premature toner outages, sending e mail fax documents may additionally offer you with a simple answer for those commonplace ills.can you fax documents online

    ReplyDelete
  6. I am definitely enjoying your website. You definitely have some great insight and great stories. how to send a fax from my phone

    ReplyDelete
  7. This is why, once one spammer gets your email, you might begin receiving spam from all over the place. People are buying and selling your email address. email extractor from website

    ReplyDelete
  8. You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this..........send fax from email
    send fax from email

    ReplyDelete
  9. We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. send fax from phone

    ReplyDelete
  10. How about we perceive how every part of room furniture needs explicit consideration when you go out for shopping! CBT Bulk Email Sender Software

    ReplyDelete
  11. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. send and receive fax android

    ReplyDelete
  12. Gathering focused on URL's and the addresses that originate from them is the most ideal approach to get delivers that are valuable to your specific circumstance. CBT Mass Email Sender

    ReplyDelete
  13. HOW I GO MY DESIRED LOAN AMOUNT FROM A RELIABLE AND TRUSTED LOAN COMPANY LAST WEEK. Email for immediate response: drbenjaminfinance@gmail.com Call/Text: +1(415)630-7138 Whatsapp +19292227023

    Hello everyone, My name is Mr.Justin Riley Johnson, I am from Texas, United State, am here to testify of how i got my loan from BENJAMIN LOAN INVESTMENTS FINANCE(drbenjaminfinance@gmail.com) after i applied Two times from various loan lenders who claimed to be lenders right here this forum,i thought their lending where real and i applied but they never gave me loan until a friend of mine introduce me to {Dr.Benjamin Scarlet Owen} the C.E.O of BENJAMIN LOAN INVESTMENTS FINANCE who promised to help me with a loan of my desire and he really did as he promised without any form of delay, I never thought there are still reliable loan lenders until i met {Dr.Benjamin Scarlet Owen}, who really helped me with my loan and changed my life for the better. I don't know if you are in need of an urgent loan also, So feel free to contact Dr.Benjamin Scarlet Owen on his email address: drbenjaminfinance@gmail.com BENJAMIN LOAN INVESTMENTS FINANCE holds all of the information about how to obtain money quickly and painlessly via Whatsapp +19292227023 Email: drbenjaminfinance@gmail.com and consider all your financial problems tackled and solved. Share this to help a soul right now, Thanks..

    ReplyDelete
  14. Do you need an urgent loan of any kind? Loans to liquidate debts or need to loan to improve your business have you been rejected by any other banks and financial institutions? Do you need a loan or a mortgage? This is the place to look, we are here to solve all your financial problems. We borrow money for the public. Need financial help with a bad credit in need of money. To pay for a commercial investment at a reasonable rate of 3%, let me use this method to inform you that we are providing reliable and helpful assistance and we will be ready to lend you. Contact us today by email: daveloganloanfirm@gmail.com Call/Text: +1(501)800-0690 And whatsapp: +1 (315) 640-3560

    NEED A LOAN?
    Ask Me.

    ReplyDelete



  15. I FEEL LIKE CRYING AS I SHARE THIS TESIMONMY OF MINE Call me frank ...People of God i was recently laid off from a great job that was giving me food and shelter due to our bad economy . I registered on several job hunting sites and got busy fiinding another job. I came across several jobs but they didn't ...i then resolute to getting a loan online to pursue my long business dreams since i was having about $10,000 left from my savings and the entire cost for my business to kick off was billed at $50,000 which means that i needed $40,000 more to start this and i thought that going online would be better since most of them pose to grant loans at cheapest rate of %1 percent or less but i never realized that i was only digging my financial grave , low and behold i got brainwashed , deceived and even spell bound to sending all my left $10,000 to them for several fees , Omg , that was so heavy for me then because my family could barely feed trice delay after that incidence as we all grew lean and sickly . but i didn't give up as i knew that the worse thing that can happen to someone is to allow their dreams shattered due to a past failure , i told my lawyer and he advice specifically that there is a United State online based loan agency in the name of AMEIR MILLER LOAN AGENCY as they are currently offering loans now without any fear or problems simply because about 2 clients that he knows got loan from that firm as it is owned by a pastor , after hearing all this i prayed to God for his leading and also followed my lawyer's advice in which i applied but God actually showed his face as this God sent online loan agency granted me this loan funds within 48 hours without any form of problems or stories after i meant with their terms and conditions.indeed at an interest rate of %2 percent , ya all can go talk to them using these ameirmillerfinancialinstitute@gmail.com or ameirmillerclassicloaninstitute@yahoo.com , ameirmillerapprovedloans@usa.com God bless yall for taking out time to reading my message to the world .

    ReplyDelete



  16. I FEEL LIKE CRYING AS I SHARE THIS TESIMONMY OF MINE Call me frank ...People of God i was recently laid off from a great job that was giving me food and shelter due to our bad economy . I registered on several job hunting sites and got busy fiinding another job. I came across several jobs but they didn't ...i then resolute to getting a loan online to pursue my long business dreams since i was having about $10,000 left from my savings and the entire cost for my business to kick off was billed at $50,000 which means that i needed $40,000 more to start this and i thought that going online would be better since most of them pose to grant loans at cheapest rate of %1 percent or less but i never realized that i was only digging my financial grave , low and behold i got brainwashed , deceived and even spell bound to sending all my left $10,000 to them for several fees , Omg , that was so heavy for me then because my family could barely feed trice delay after that incidence as we all grew lean and sickly . but i didn't give up as i knew that the worse thing that can happen to someone is to allow their dreams shattered due to a past failure , i told my lawyer and he advice specifically that there is a United State online based loan agency in the name of AMEIR MILLER LOAN AGENCY as they are currently offering loans now without any fear or problems simply because about 2 clients that he knows got loan from that firm as it is owned by a pastor , after hearing all this i prayed to God for his leading and also followed my lawyer's advice in which i applied but God actually showed his face as this God sent online loan agency granted me this loan funds within 48 hours without any form of problems or stories after i meant with their terms and conditions.indeed at an interest rate of %2 percent , ya all can go talk to them using these ameirmillerfinancialinstitute@gmail.com or ameirmillerclassicloaninstitute@yahoo.com , ameirmillerapprovedloans@usa.com God bless yall for taking out time to reading my message to the world .

    ReplyDelete



  17. I FEEL LIKE CRYING AS I SHARE THIS TESIMONMY OF MINE Call me frank ...People of God i was recently laid off from a great job that was giving me food and shelter due to our bad economy . I registered on several job hunting sites and got busy fiinding another job. I came across several jobs but they didn't ...i then resolute to getting a loan online to pursue my long business dreams since i was having about $10,000 left from my savings and the entire cost for my business to kick off was billed at $50,000 which means that i needed $40,000 more to start this and i thought that going online would be better since most of them pose to grant loans at cheapest rate of %1 percent or less but i never realized that i was only digging my financial grave , low and behold i got brainwashed , deceived and even spell bound to sending all my left $10,000 to them for several fees , Omg , that was so heavy for me then because my family could barely feed trice delay after that incidence as we all grew lean and sickly . but i didn't give up as i knew that the worse thing that can happen to someone is to allow their dreams shattered due to a past failure , i told my lawyer and he advice specifically that there is a United State online based loan agency in the name of AMEIR MILLER LOAN AGENCY as they are currently offering loans now without any fear or problems simply because about 2 clients that he knows got loan from that firm as it is owned by a pastor , after hearing all this i prayed to God for his leading and also followed my lawyer's advice in which i applied but God actually showed his face as this God sent online loan agency granted me this loan funds within 48 hours without any form of problems or stories after i meant with their terms and conditions.indeed at an interest rate of %2 percent , ya all can go talk to them using these ameirmillerfinancialinstitute@gmail.com or ameirmillerclassicloaninstitute@yahoo.com , ameirmillerapprovedloans@usa.com God bless yall for taking out time to reading my message to the world .

    ReplyDelete
  18. I want to use this medium to alert all loan seekers to be very careful because there are scam everywhere. Few months ago I was financially strained, and due to my desperation I was scammed by several online lenders. I had almost lost hope until a friend of mine referred me to a very reliable lender called Karin Sabine who lend me an unsecured loan of 10,000.00 Euro under 24Hours without any stress. If you are in need of any kind of loan just contact them now via email: sabinhelps@gmail.com or WhatsApp +79267494861.

    ReplyDelete


  19. ??DO YOU WANT TO RECOVER YOUR LOST FUNDS ON CAPITAL INVESTMENTS, BITCOIN INVESTMENTS, AND OTHER SCAM TRADING INVESTMENTS ??? TAKE YOUR TIME TO READ??

    ?? We have received numerous complaints of fraud associated with websites that offers opportunities for Capital Investments,
    bitcoin investments and Trading on an Internet-based trading platforms. Most Of The complaints falls into these Two categories:
    1. ??Refusal to credit customers accounts or reimburse funds to customers:
    These complaints typically involve customers who have deposited money into their trading or investment account and who are then encouraged
    by “brokers” over the telephone to deposit additional funds into the customer account.
    When customers later attempt to withdraw their original deposit or the return they have been promised, the trading platforms allegedly cancels customers’ withdrawal requests, refuse to credit their accounts, or ignore their telephone calls and emails.

    2. ??Manipulation of software to generate losing trades:
    These complaints allege that the Internet-based Investment and trading platforms manipulate the trading software to distort the Trading prices and payouts in order to ensure that the trade results in a Loss. For example, when a customer’s trade is “winning,” the countdown to expiration is extended arbitrarily until the trade becomes a loss.

    ?? Most people have lost their hard earned money through Scam Investments And Trading, yet they would go and meet fake recovery Experts unknowingly to help them recover their money and they would end up losing more money in the process. This Is Basically why we (Thehackerspro.com) have come to y’all victim’s rescue. The clue is most of these Brokers have weak Database security, and their vulnerabilities can be exploited easily with the Help of our Special HackTools, Root HackTools And Technical Hacking Strategies because they wouldn’t wanna spend money in the sponsorship of Bug bounty Programs which would have helped protect their Database from Unauthorized access to their Database, So all our specialists do is to hack into the Broker’s Database via SQL Hook injections & DNS Spoofing, Decrypt your Transaction Details, Trace the Routes of your Deposited Funds, Then some Technical Hacking Algorithms & Execution Which we cant explain here would follow then you have your money recovered. ?? ??

    ??All our Specialists are well experienced in their various niches with Great Skills, Technical Hacking Strategies And Positive Online Reputations And Recommendations??
    They hail from a proven track record and have cracked even the toughest of barriers to intrude and capture all relevant data needed by our Clients.
    We have Digital Forensic Specialists, Certified Ethical Hackers, Software Engineers, Cyber Security Experts, Private investigators and more. Our Goal is to make your digital life secure, safe and hassle free by Linking you Up With these great Professionals such as JACK CABLE, ARNE SWINNEN, SEAN MELIA, DAWID CZAGAN, BEN SADEGHIPOUR And VLADIMIR KOLAROV More. These Professionals are Well Reserved Professionals who are always ready to Handle your job with great energy and swift response so that your problems can be solved very quickly.
    All You Need to Do is to send us a mail or talk with support on the website who will set you up for a schedule and we’ll Assign any of these specialists to Handle your Job immediately.

    ?? Below Is A Full List Of Our Services:
    * FUNDS RECOVERY ON INVESTMENT AND TRADING.
    * WEBSITE HACKING
    * CREDIT REPAIR.
    * PHONE HACKING (giving you Unnoticeable access to everything Happening on the Target’s Phone)
    * CLEARING OF CRIMINAL RECORDS
    * SOCIAL MEDIA ACCOUNTS HACKING


    ?? CONTACT:
    ••• Email:
    int.hackers002@gmail.com


    ??2021 © Mikefisher
    ??Want faster service? Contact us!
    ??All Rights Reserved ®?

    ReplyDelete

  20. Tried a lot of hackers but i strongly recommend thehackerspro.com where i eventually hired the dreaded darkhat hacker vladimir kolarov
    although he was much more expensive than other hackers i contacted but he did a good job and their customer support on the website is friendly and very helpful.
    These are ethical hackers that’ll solve all your problems like hack emails,Facebook, Twitter ,Instagram , change grades ,
    erase criminal records, credit and debit top up, insurance paper,
    access or recover lost files, background checks on individuals and organizations
    or monitor cheating spouses’ phone or social media activities, contact at h4ckerspro@gmail.com or call/text 1 646 948 8125.
    for faster and direct access just add him on telegram @h4ckerspro

    ReplyDelete
  21. Do you need Personal Finance?
    Business Cash Finance?
    Unsecured Finance
    Fast and Simple Finance?
    Quick Application Process?
    Finance. Services Rendered include,
    *Debt Consolidation Finance
    *Business Finance Services
    *Personal Finance services Help
    contact us today and get the best lending service
    personal cash business cash just email us below
    Contact Us: financialserviceoffer876@gmail.com
    call or add us on what's app +918929509036

    ReplyDelete
  22. Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. mailchimp alternatives

    ReplyDelete
  23. At this point you'll find out what is important, it all gives a url to the appealing page: CBT Bulk Email Sender

    ReplyDelete
  24. TESTIMONY ON HOW I GOT MY LOAN FROM A GENUINE FINANCE COMPANY LAST WEEK. Call/Text: +1(646)820-1981 Email for immediate response: drbenjaminfinance@gmail.com
    WhatsApp +19292227023 Visit their Company Website: https://capitalmanage-inc.com/


    Good Day everyone, My name is Mrs. McCarthy Juan, I have been a scam victim to so many fake lenders online between November last year till march this year but i thank my God so much that he has finally smiled on me by directing me to this new loan lender who put a smile on my face this year 2021 and he did not scam me and also by not deceiving or lying to me and my friends but however this lending firm is CAPITAL MANAGEMENTS INC (drbenjaminfinance@gmail.com) gave me 2% interest loan for my business expansion amount $900,000.00 united states dollars after my agreement to their company terms and conditions and one significant thing i love about this loan company is that they are fast and unique. {Dr. Benjamin Scarlet Owen} can also help you with a legit loan offer. He Has also helped some other colleagues of mine. If you need a genuine loan without cost/stress he his the right loan lender to wipe away your financial problems and crisis today. CAPITAL MANAGEMENTS INC holds all of the information about how to obtain money quickly and painlessly via Email: drbenjaminfinance@gmail.com

    When it comes to financial crisis and loan offer then ®Capital Managements Inc™ 2021 is the place to go please just tell him, I Mrs. McCarthy Juan direct you Good Luck.



    Loan Company Website: https://capitalmanage-inc.com/

    ReplyDelete
  25. My name is Mr. Klaus Dieter, I work for the French financial institution Crédit Mutuel with the partnership of the bank BNP Paribas, we offer you offers at an interest rate of 3% per year, to start with new projects:
    - You have unpaid debt.
    - Buying a new house.
    - buy a new car.
    - Buying a new apartment or property.
    Get personal loans, business loans.
    If you would like loans for setting up your business and project, do not hesitate to send us an email:
    bnpfinanzenhilfe@gmail.com

    Whatsapp: +4917694954827

    ReplyDelete
  26. Email promoting administrations give viable and simple approach to get accomplishes wanted advertising objectives. Through Email benefits your message or administrations is shipped off clients. It's likewise assists with developing relationship with the clients by customized and pertinent email correspondences. Email showcasing is a best and least expensive approach to disseminate your business messages to clients or public portion by means of mailer (email).email marketing

    ReplyDelete
  27. My name is Patricia from united states, i am here to share testimony on how i benefited from an investment platform i never believed, i was scammed by some traders online and i lost almost all my savings, i quit participating on investment programs because the scams are too much online,months after i saw a testimony of Miguel silvia online that touched me, her experience was similar with Mine i contacted her via the comment because she also posted the profit payment proof , after talking with her and she assured me that (wilsontradeszone) is real and legit, i still had a lot of doubt because there are much of this similar comments of others, i thinked about it and i give it a try few days later and invested $850 worth of bitcoin with him ,yesterday been my withdrawal date i received my profit of $7,225.00 after they deducted there commission without stress and i am reinvesting with him i never believed him right now i had paid my necessary bills and i reinvested again thanks Mr Wilson for giving me life.. if you also had bad a experience like mine i will advise you to contact Mr Wilson on whatsapp: +27633586789 or email: wilsontradeszone@gmail.com for new investors also looking for legit cryptocurrency trader Mr Wilson is all you need

    ReplyDelete
  28. Wow this is awesome, very interesting article. I can imagine the energy and inspiration you have invested on this powerful combination of words. Many articles I come across these days do not really dive this deep to make it clear to their audience as you did. But believe me the way you interact is literally 100% perfect. I will instantly grab your rss feed to stay informed of any updates you make on your blog and as well take the advantage to demonstrate
    5 WAYS TO SPOT A FAKE DRIVERS LICENSE which many people are ignorant of when ordering fake documents online. Not over demanding I will also take the advantage to ask for your permission to join our 179.3k members TELEGRAM GROUP
    to share with us your ideas or any latest update on your blog.
    Thanks I am Scott from Globex, we are expecting you on our platform.

    ReplyDelete
  29. It is somewhat fantastic, and yet check out the advice at this treat. 1.4 email extractor

    ReplyDelete
  30. one upon a time when i had a ring on and promised that death could only do us part if not nothing more. The vow lasted shorter than i expected but as I always say, "marriage is like a party, when it ends, you leave".
    It too me no time to start suspecting my ex-husband cause he spent more time on his phone and on few occasions i have seen him smiling to his phone while texting. I was curious and needed to have answers. I confided in a friend and she suggested that i get some one who could help me gain access to his cell phone without his knowledge. The search for a professional ensued and i met couple of fake guys who got away with my money but since i needed answers i didn't give up the search while i still tried to find ways i could get his phone and access it, i got lucky one time but he had changed his password. I eventually met some dude 'alienm4n" whom i added on skype and he helped me,check.
    I was eventually able to get all the necessary information i needed to confront the unfaithful man and bring the whole marriage thing to a halt. You can contact them via (alienmanhackers.xyz) or alienmanh4cck @protonmail.com
    My candid advice is know whoever you want to end up with and where you are not respected or loved, leave!!

    ReplyDelete
  31. This is very significant, and yet necessary towards just click this unique backlink: find out here now

    ReplyDelete
  32. Do you need an urgent loan of any kind? Loans to liquidate debts or need to loan to improve your business have you been rejected by any other banks and financial institutions? Do you need a loan or a mortgage? This is the place to look, we are here to solve all your financial problems. We borrow money for the public. Need financial help with a bad credit in need of money. To pay for a commercial investment at a reasonable rate of 3%, let me use this method to inform you that we are providing reliable and helpful assistance and we will be ready to lend you. Contact us today by email: daveloganloanfirm@gmail.com Call/Text: +1(501)800-0690 And whatsapp: +1 (501) 214‑1395

    NEED A LOAN?
    Ask Me.

    ReplyDelete
  33. When a person visits your website and thinks of subscribing to your mailing list with the aim to keep in touch with you through email, it is known as email marketing. email marketing software

    ReplyDelete
  34. DO YOU NEED A PERSONAL/BUSINESS/INVESTMENT LOAN? CONTACT US TODAY VIA WhatsApp +19292227023 Email drbenjaminfinance@gmail.com

    HELLO
    Loan Offer Alert For Everyone! Are you financially down and you need an urgent credit/financial assistance? Or are you in need of a loan to start-up/increase your business or buy your dream house. GET YOUR INSTANT LOAN APPROVAL 100% GUARANTEED TODAY NO MATTER YOUR CREDIT SCORE. WhatsApp:+19292227023 Email: drbenjaminfinance@gmail.com

    ReplyDelete
  35. Hello my name is James a graduate of Kansas State University with a degree in cyber security science and later did my masters at Oxford University. I'm now the CEO of watch precinct cyber security, an organization designed to suit your web desires. At watch precinct we cover a wide range of services and at an unbeatable rate. It doesn't matter what job is as long it's on the internet we've got you covered. So send us an email today at watchprecinct@gmail.com and let us be at your service.
    Wether it is
    ➡️BTC RECOVERY
    ➡️ credit score upgrade
    ➡️ Crypto investment
    ➡️blank ATM card
    ➡️result score upgrade
    ➡️ keeping an eye on that unfaithful spouse
    ➡️ getting a loan
    ➡️darkweb purchase

    We've got you covered, all it takes is just an email and we are right on it and at jet speed too.
    So what are you waiting for?
    Email us today at watchprecinct@gmail.com and let us take care of it.
    Looking forward to working with you and for you.

    ReplyDelete