Bewerken

Share via


sp_delete_alert (Transact-SQL)

Applies to: SQL Server

Removes an alert.

Transact-SQL syntax conventions

Syntax

sp_delete_alert [ @name = ] N'name'
[ ; ]

Arguments

[ @name = ] N'name'

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

Return code values

0 (success) or 1 (failure).

Result set

None.

Remarks

Removing an alert also removes any notifications associated with the alert.

Permissions

This stored procedure is owned by the db_owner role. You can grant EXECUTE permissions for any user, but these permissions may be overridden during a SQL Server upgrade.

Examples

The following example removes an alert named Test Alert.

USE msdb;
GO

EXEC dbo.sp_delete_alert
    @name = N'Test Alert';
GO