locked
Email Notifications RRS feed

  • Question

  • Hi, 

    I have several real time feeds that populates tables from the source. I want to set up email notification to send out an alert when the data feed is not populated from the real time process. 

    On Basic Level:

    I need to set up a job that queries the real time tables. If there is no data found to be populated for over an hour I need to set up email notification to the concerned tech group and business group. 

    What would be the best possible solution to implement such kind of notifications. 

    Please guide..

    Thanks


    EVA05

    Monday, January 28, 2013 2:33 PM

Answers

  • You need to configure db_email feature

    http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/

    IF (SELECT COUNT(*) FROM tbl) =0

    BEGIN

    EXEC msdb.dbo.sp_send_dbmail 
         @profile_name = 'Admin', 
         @recipients = 'kkkk@gmail.com', 
          @subject = 'The table is empty' ;

    END


    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance

    • Proposed as answer by Lucas Kartawidjaja Monday, January 28, 2013 3:19 PM
    • Marked as answer by eva05 Monday, January 28, 2013 6:44 PM
    Monday, January 28, 2013 2:38 PM
    Answerer

All replies

  • You need to configure db_email feature

    http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/

    IF (SELECT COUNT(*) FROM tbl) =0

    BEGIN

    EXEC msdb.dbo.sp_send_dbmail 
         @profile_name = 'Admin', 
         @recipients = 'kkkk@gmail.com', 
          @subject = 'The table is empty' ;

    END


    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Blog: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance

    • Proposed as answer by Lucas Kartawidjaja Monday, January 28, 2013 3:19 PM
    • Marked as answer by eva05 Monday, January 28, 2013 6:44 PM
    Monday, January 28, 2013 2:38 PM
    Answerer
  • Open the job, go to notifications and select Email, choose the operator you created, and the condition "When the job fails".


    Please mark as helpful and propose as answer if you find this as correct!!! Thanks,Dia Agha .

    Monday, January 28, 2013 2:41 PM