Transact-SQL 参考

sp_update_notification

更新警报提示的提示方法。

语法

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

请参见

sp_add_notification

sp_delete_notification

sp_help_notification

系统存储过程