locked
Disable Alert With T-SQL RRS feed

  • Question

  • In SQL Server 2005, how do you disable/enable an Alert using T-SQL?

    All examples I have found are using SSMS.

    Wednesday, December 29, 2010 12:12 AM

Answers

  • USE msdb ;
    GO
    
    EXEC dbo.sp_update_alert
      @name = N'Test Alert',
      @enabled = 0 ;
    GO
     
    
    

    http://www.t-sql.ru
    • Proposed as answer by Devender Bijania Wednesday, December 29, 2010 4:23 AM
    • Marked as answer by FogHorn I Thursday, December 30, 2010 12:49 AM
    Wednesday, December 29, 2010 4:18 AM

All replies

  • USE msdb ;
    GO
    
    EXEC dbo.sp_update_alert
      @name = N'Test Alert',
      @enabled = 0 ;
    GO
     
    
    

    http://www.t-sql.ru
    • Proposed as answer by Devender Bijania Wednesday, December 29, 2010 4:23 AM
    • Marked as answer by FogHorn I Thursday, December 30, 2010 12:49 AM
    Wednesday, December 29, 2010 4:18 AM
  • To Disable
    1. EXEC msdb.dbo .SP_UPDATE_JOB @job_id = '8386ED61-E2A8-4DE5-B54C-4A7DFD3CDDEC' , @enabled = 0
    To Enable

    1. EXEC msdb.dbo .SP_UPDATE_JOB @job_id = '8386ED61-E2A8-4DE5-B54C-4A7DFD3CDDEC' , @enabled = 1
    have a nice day

    Please mark the replies as answers if they help. Kumar
    Wednesday, December 29, 2010 4:23 AM
  • look at this:--

    http://msdn.microsoft.com/en-us/library/ms178616.aspx


     


    --------------------------------- Devender Bijania
    • Proposed as answer by Amit Kumar222 Monday, May 13, 2013 9:35 AM
    • Unproposed as answer by Amit Kumar222 Monday, May 13, 2013 9:35 AM
    Wednesday, December 29, 2010 4:25 AM
  • You Can Also update the

    sysalerts  table for Enable or Desable Alerts


    update sysalerts set enable=0   '' for disable alert

    update sysalerts set enable=1   '' for enable alert

    Monday, May 13, 2013 9:36 AM
  • this was helpful,thanks
    Monday, May 13, 2013 11:41 AM
  • Thanks, was helpful
    Monday, May 13, 2013 11:43 AM