更新警報(bào)提示的提示方法。
sp_update_notification [@alert_name =] 'alert',
[@operator_name =] 'operator',
[@notification_method =] notification
[@alert_name =] 'alert'
是與此提示相關(guān)聯(lián)的警報(bào)名稱。alert 的數(shù)據(jù)類型為 sysname,無(wú)默認(rèn)值。
[@operator_name =] 'operator'
是警報(bào)發(fā)生時(shí)所要通知的操作員。operator 的數(shù)據(jù)類型為 sysname,無(wú)默認(rèn)值。
[@notification_method =] notification
是通知操作員的方法。notification 的數(shù)據(jù)類型為 tinyint,無(wú)默認(rèn)值,且可以取下列值中的一個(gè)或多個(gè)值。
值 | 描述 |
---|---|
1 | 電子郵件 |
2 | 呼叫程序 |
4 | net send |
7 | 所有方法 |
0(成功)或 1(失?。?/P>
sp_update_notification 必須從 msdb 數(shù)據(jù)庫(kù)中運(yùn)行。
可以為不具有指定的 notification_method 所必需的地址信息的操作員更新提示。如果發(fā)送電子郵件或呼叫程序提示時(shí)出現(xiàn)故障,則該故障將被記錄到 SQL Server 代理程序錯(cuò)誤日志。
只有 sysadmin 固定服務(wù)器角色的成員才能執(zhí)行 sp_update_notification。
下例為發(fā)送給 stevenb 的提示修改提示方法,該提示是為警報(bào) Test Alert 發(fā)送的。
USE msdb
EXEC sp_update_notification 'Test Alert', 'stevenb', 7
相關(guān)文章