Alert Object

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The Alert object represents a single SQL Server Agent alert. Alerts respond to either specific Microsoft SQL Server error messages or SQL Server errors of a specified severity.

현재 개체를 보여 주는 SQL-DMO 개체 모델

Properties

Category Property

JobID Property

CountResetDate Property

JobName Property

CountResetTime Property (SQL-DMO)

LastOccurrenceDate Property

DatabaseName Property

LastOccurrenceTime Property

DelayBetweenResponses Property

LastResponseDate Property

Enabled Property

LastResponseTime Property

EventCategoryID Property

MessageID Property

EventDescriptionKeyword Property

Name Property

EventID Property

NotificationMessage Property

EventSource Property

OccurrenceCount Property

HasNotification Property

PerformanceCondition Property

ID Property

Severity Property

IncludeEventDescription Property

Type Property (Alert)

Methods

AddNotification Method

Remove Method (Objects)

BeginAlter Method

RemoveNotification Method

CancelAlter Method

ResetOccurrenceCount Method

DoAlter Method

Script Method

EnumNotifications Method

UpdateNotification Method

Refresh Method

 

주의

You can use the Alert object to create and manage SQL Server Agent alerts:

  • Create an alert to respond to a specific SQL Server error.
  • Change the properties of an existing alert to modify its behavior.
  • Change the notified operators on an instance of the error condition.

The Name property of an Alert object uses the SQL Server data type sysname. The string must be a unique value for each Alert object in the Alerts collection.

SQL Server does not allow the creation of more than one alert on any given error condition or severity level. More than one alert can be defined on a specific message identifier; however, each alert defined must be limited in scope by associating the alert with a specific database.

SQL Server alerts are enabled by default. However, an alert created with the minimum required values will fire no notifications. You must assign operators to the alert by using the AddNotification method of the Alert or Operator object.

To create an alert

  1. Create an Alert object.

  2. Set the Name property.

  3. Set the response type for the alert by setting the value of the Severity property or the MessageID property.

  4. Set any optional properties you want. For example, set the DatabaseName property to limit the alert's action to a specific database, or use the AddNotification method to add operators to the alert.

  5. Add the Alert object to the Alerts collection of a connected JobServer object.

To alter an existing alert

  1. Get an Alert object from the Alerts collection of a connected JobServer object.

  2. Use the BeginAlter method to mark the beginning of the changes.

  3. Set the Alert object properties to reflect changes in alert behaviors.

  4. Use the DoAlter method to submit the alert changes to SQL Server.

참고 항목

참조

Operator Object

관련 자료

경고 정의

도움말 및 정보

SQL Server 2005 지원 받기