更新警报提示的提示方法。
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 所必需的地址信息的操作员更新提示。如果发送电子邮件或呼叫程序提示时出现故障,则该故障将被记录到 SQL Server 代理程序错误日志。
只有 sysadmin 固定服务器角色的成员才能执行 sp_update_notification。
下例为发送给 stevenb 的提示修改提示方法,该提示是为警报 Test Alert 发送的。
USE msdb
EXEC sp_update_notification 'Test Alert', 'stevenb', 7