Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Updating Alert Settings

Updated on 2025-01-22 GMT+08:00

Scenarios

You can use a stored procedure to update the settings of an existing alert.

Prerequisites

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

Procedure

Run the following commands to update the settings of an existing alert:

EXEC [msdb].[dbo].[rds_update_alert]

@name='name',

@new_name = 'new_name',

@message_id=message_id,

@severity=severity,

@enabled=enabled,

@delay_between_responses= delay_between_responses,

@notification_message='notification_message',

@include_event_description_in=include_event_description_in,

@database_name='database',

@event_description_keyword= 'event_description_keyword',

@job_id=job_id | @job_name='job_name',

@occurrence_count= occurrence_count,

@count_reset_date= count_reset_date,

@count_reset_time= count_reset_time,

@last_occurrence_date= last_occurrence_date,

@ last_occurrence_time= last_occurrence_time,

@ last_response_date= last_response_date,

@ last_response_time= last_response_time,

@ raise_snmp_trap= raise_snmp_trap,

@ performance_condition= 'performance_condition',

@category_name='category',

@wmi_namespace='wmi_namespace',

@wmi_query='wmi_query';

Table 1 Parameter description

Parameter

Description

'name'

The name of the alert that is to be updated. name is sysname, with no default.

'new_name'

A new name for the alert. The name must be unique. new_name is sysname, with a default of NULL.

message_id

A new message or error number for the alert definition. Typically, message_id corresponds to an error number in the sysmessages table. message_id is int, with a default of NULL. A message ID can be used only if the severity level setting for the alert is 0.

severity

A new severity level (from 1 through 25) for the alert definition. Any SQL Server message sent to the Windows application log with the specified severity will activate the alert. severity is int, with a default of NULL. A severity level can be used only if the message ID setting for the alert is 0.

enabled

Whether the alert is enabled (1) or not enabled (0). enabled is tinyint, with a default of 1 (enabled). If the value is 0, the alert is not enabled and does not fire.

delay_between_responses

The new waiting period, in seconds, between responses to the alert. delay_between_responses is int, with a default of 0, which means there is no waiting between responses (each occurrence of the alert generates a response). The response can be in either or both of these forms:

  • One or more notifications sent through e-mail or pager.
  • A job to execute.

    By setting this value, it is possible to prevent, for example, unwanted e-mail messages from being sent when an alert repeatedly occurs in a short period of time.

'notification_message'

The revised text of an additional message sent to the operator as part of the e-mail, net send, or pager notification. notification_message is nvarchar(512), with a default of NULL. Specifying notification_message is useful for adding special notes such as remedial procedures.

include_event_description_in

Whether the description of the SQL Server error from the Windows application log should be included in the notification message. include_event_description_in is tinyint, with a default of NULL, and can be one or more of these values.

  • 0: None
  • 1: E-mail
  • 2: Pager
  • 4: net send
  • 7: All

'database'

The name of the database in which the error must occur for the alert to fire. If database is not supplied, the alert fires regardless of where the error occurred. database is sysname. Names that are enclosed in brackets ([ ]) are not allowed. The default value is NULL.

'event_description_keyword'

A sequence of characters that must be found in the description of the error in the error message log. Transact-SQL LIKE expression pattern-matching characters can be used. event_description_keyword is nvarchar(100), with a default of NULL. This parameter is useful for filtering object names (for example, %customer_table%).

job_id

The job identification number. job_id is uniqueidentifier, with a default of NULL. If job_id is specified, job_name must be omitted.

'job_name'

The name of the job that executes in response to this alert. job_name is sysname, with a default of NULL. If job_name is specified, job_id must be omitted.

occurrence_count

Resets the number of times the alert has occurred. occurrence_count is int, with a default of NULL, and can be set only to 0.

count_reset_date

Resets the date the occurrence count was last reset. count_reset_date is int, with a default of NULL.

count_reset_time

Resets the time the occurrence count was last reset. count_reset_time is int, with a default of NULL.

last_occurrence_date

Resets the date the alert last occurred. last_occurrence_date is int, with a default of NULL, and can be set only to 0.

last_occurrence_time

Resets the time the alert last occurred. last_occurrence_time is int, with a default of NULL, and can be set only to 0.

last_response_date

Resets the date the alert was last responded to by the SQL Server Agent service. last_response_date is int, with a default of NULL, and can be set only to 0.

last_response_time

Resets the time the alert was last responded to by the SQL Server Agent service. last_response_time is int, with a default of NULL, and can be set only to 0.

raise_snmp_trap

Reserved.

'performance_condition'

A value expressed in the format "itemcomparatorvalue." performance_condition is nvarchar(512), with a default of NULL, and consists of the following elements:

  • Item: A performance object, performance counter, or named instance of the counter
  • Comparator: One of these operators: >, <, or =
  • ReplTest1: Numeric value of the counter

'category'

The name of the alert category. category is sysname, with a default of NULL.

'wmi_namespace'

The WMI namespace to query for events. wmi_namespace is sysname, with a default of NULL.

'wmi_query'

The query that specifies the WMI event for the alert. wmi_query is nvarchar(512), with a default of NULL.

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

Commands completed successfully.

Example

The command output is as follows.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback