SQL mail Alert from eventlog message without sql agent help

Rajkumar Sivanpandi 1 Reputation point
2022-03-30T10:19:58.973+00:00

Requirement:

    1. Suppose SQL agent get stopped in middle, how to send mail alert

    2. Suppose TempDB got full. In that situation mail will be triggered based on reading event log message (not by sql agent job)  
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,665 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tom Phillips 17,741 Reputation points
    2022-03-30T14:32:46.62+00:00

    You would need a 3rd party app monitoring the Windows Error Log. There are many of them, including SCOM from Microsoft.


  2. LiHong-MSFT 10,051 Reputation points
    2022-03-31T07:32:38.147+00:00

    Hi @Rajkumar Sivanpandi
    It seams you can run a Powershell script which will send an email and terminate (to avoid spam) if the SQL agent fails for any reason. Start the task again after restarting SQL Server to continue monitoring.
    And here are some similar threads that you can refer to:
    Send email alert when SQL Server Agent stops/fails
    How to notify through DB MAIL when sql server agent stopped automatically?

    Best regards,
    LiHong

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.