Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 2.74 KB

sp-update-notification-transact-sql.md

File metadata and controls

92 lines (66 loc) · 2.74 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_update_notification (Transact-SQL)
Updates the notification method of an alert notification.
markingmyname
maghan
randolphwest
08/28/2023
sql
system-objects
reference
sp_update_notification_TSQL
sp_update_notification
sp_updatenotification
TSQL

sp_update_notification (Transact-SQL)

[!INCLUDE SQL Server]

Updates the notification method of an alert notification.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

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

Arguments

[ @alert_name = ] N'alert_name'

The name of the alert associated with this notification. @alert_name is sysname, with no default.

[ @operator_name = ] N'operator_name'

The operator who is notified when the alert occurs. @operator_name is sysname, with no default.

[ @notification_method = ] notification_method

The method by which the operator is notified. @notification_method is tinyint, and can be one or more of these values.

Value Description
1 E-mail
2 Pager
4 net send
7 All methods

Return code values

0 (success) or 1 (failure).

Remarks

sp_update_notification must be run from the msdb database.

You can update a notification for an operator who doesn't have the necessary address information using the specified notification_method. If a failure occurs when sending an e-mail message or pager notification, the failure is reported in the [!INCLUDE ssnoversion-md] Agent error log.

Permissions

To run this stored procedure, users must be granted the sysadmin fixed server role.

Examples

The following example modifies the notification method for notifications sent to François Ajenstatfor the alert 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

Related content