Share via


sp_update_notification (Transact-SQL)

更新警示通知的通知方法。

主題連結圖示Transact-SQL 語法慣例

語法

sp_update_notification
          [@alert_name =] 'alert' ,
     [@operator_name =] 'operator' ,
     [@notification_method =] notification

引數

  • [@alert_name =] 'alert'
    這項通知的相關警示名稱。alert 是 sysname,沒有預設值。

  • [@operator_name =] 'operator'
    發生警示時所要通知的操作員。operator 是 sysname,沒有預設值。

  • [@notification_method =] notification
    用來通知操作員的方法。notification是 tinyint,沒有預設值,它可以是下列值之一。

    描述

    1

    電子郵件

    2

    呼叫器

    4

    net send

    7

    所有方法

傳回碼值

0 (成功) 或 1 (失敗)

備註

sp_update_notification 必須從 msdb 資料庫中執行。

您可以利用指定的 notification_method 來更新沒有必要位址資訊之操作員的通知。如果傳送電子郵件訊息或呼叫器通知失敗,會在 Microsoft SQL Server Agent 錯誤記錄中報告這項失敗。

權限

若要執行這個預存程序,必須授與使用者系統管理員 (sysadmin) 固定伺服器角色。

範例

下列範例會修改針對 Test Alert 警示而傳給 François Ajenstat 的通知之通知方法。

USE msdb ;
GO

EXEC dbo.sp_update_notification
   @alert_name = N'Test Alert',
   @operator_name = N'François Ajenstat',
   @notification_method = 7;
GO