Skip to content

Latest commit

 

History

History
86 lines (62 loc) · 2.47 KB

sp-delete-notification-transact-sql.md

File metadata and controls

86 lines (62 loc) · 2.47 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_delete_notification (Transact-SQL)
Removes a SQL Server Agent notification definition for a specific alert and operator.
markingmyname
maghan
randolphwest
01/23/2024
sql
system-objects
reference
sp_delete_notification_TSQL
sp_delete_notification
sp_delete_notification
TSQL

sp_delete_notification (Transact-SQL)

[!INCLUDE SQL Server]

Removes a [!INCLUDE ssNoVersion] Agent notification definition for a specific alert and operator.

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

Syntax

sp_delete_notification
    [ @alert_name = ] N'alert_name'
    , [ @operator_name = ] N'operator_name'
[ ; ]

Arguments

[ @alert_name = ] N'alert_name'

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

[ @operator_name = ] N'operator_name'

The name of the operator. @operator_name is sysname, with no default.

Return code values

0 (success) or 1 (failure).

Result set

None.

Remarks

Removing a notification removes only the notification; the alert and the operator are left intact.

Permissions

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

Examples

The following example removes the notification sent to operator François Ajenstat when alert Test Alert occurs.

USE msdb;
GO

EXEC dbo.sp_delete_notification
    @alert_name = 'Test Alert',
    @operator_name = 'François Ajenstat' ;
GO

Related content