sp_update_notification (Transact-SQL)

适用于:SQL Server

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

Transact-SQL 语法约定

语法

sp_update_notification
    [ @alert_name = ] N'alert_name'
    , [ @operator_name = ] N'operator_name'
    , [ @notification_method = ] notification_method
[ ; ]

参数

[ @alert_name = ] N'alert_name'

与该通知关联的警报的名称。 @alert_name为 sysname,无默认值。

[ @operator_name = ] N'operator_name'

警报发生时通知的操作员。 @operator_namesysname,无默认值。

[ @notification_method = ] notification_method

通知操作员的方法。 @notification_method是 tinyint,可以是其中一个或多个值。

说明
1 电子邮件
2 寻呼机
4 net send
7 所有方法

返回代码值

0(成功)或 1(失败)。

备注

sp_update_notification 必须从 msdb 数据库运行。

可以使用指定的 notification_method为没有必要地址信息的操作员更新通知。 如果在发送电子邮件或寻呼通知时发生故障,则会在SQL Server 代理错误日志中报告失败。

权限

若要运行此存储过程,必须向用户授予 sysadmin 固定服务器角色。

示例

以下示例修改发送到 François Ajenstat警报 Test Alert的通知的通知方法。

USE msdb;
GO

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

另请参阅