Help Center > > User Guide> Working with RDS for SQL Server> Usage of Stored Procedures> Setting Up Notifications for Alert

Setting Up Notifications for Alert

Updated at: May 26, 2020 GMT+08:00

Scenarios

You can use a stored procedure to set up a notification for an alert.

Prerequisites

An RDS Microsoft SQL Server DB instance has been connected. Connect to the DB instance through the Microsoft SQL Server client. For details, see Connecting to a DB Instance Through a Public Network.

Procedure

Run the following commands to set up notifications for the alert:

EXEC [msdb].[dbo].[rds_add_notification]

@alert_name='alert'

@operator_name='operator'

@notification_method= notification_method

Table 1 Parameter description

Parameter

Description

'alert'

The alert for this notification. alert is sysname, with no default.

'operator'

The operator to be notified when the alert occurs. operator is sysname, with no default.

notification_method

The method by which the operator is notified. notification_method is tinyint, with no default. notification_method can be one or more of these values combined with an OR logical operator.

  • 1: E-mail
  • 2: Pager
  • 4: net send

After the command is executed, the system displays the following information.

Commands completed successfully.

Example

The following figure shows an example command output.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel