AddNotification Method
この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。 新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。
The AddNotification method associates operators with alerts. Operators designated receive notification messages when an event raising the alert occurs.
構文
object.AddNotification(str ,NotificationType)
Parts
object
Expression that evaluates to an object in the Applies To list.str
String that specifies a Microsoft SQL Server Agent operator or alert by name.NotificationType
Long integer that specifies a method for notification message delivery as described in Settings.
Prototype (C/C++)
HRESULT AddNotification(
SQLDMO_LPCSTR strAlertOrOperator,
SQLDMO_NOTIFY_TYPE NotifyMethod);
Settings
The NotificationType argument is a bit-packed, long integer value. Specify more than a single notification method by combining values using the OR logical operator.
Constant |
Value |
Description |
---|---|---|
SQLDMONotify_All |
7 |
Notification by e-mail, e-mail sent to the pager address, and network pop-up message. |
SQLDMONotify_Email |
1 |
Notification by e-mail sent to the operator e-mail address. |
SQLDMONotify_NetSend |
4 |
Notification by network pop-up message posted to the operator network address. |
SQLDMONotify_None |
0 |
No notification method specified for the referenced operator. |
SQLDMONotify_Pager |
2 |
Notification by e-mail sent to the operator pager address. |
説明
The AddNotification method can be used to add an alert to the list of alerts that generate operator notification, or an operator to the list of those notified when the alert is raised.
For the Alert object, the str argument identifies an operator. For the Operator object, str identifies an alert.