Поделиться через


Класс Alert

The Alert class represents a Microsoft SQL Server Agent alert.

Иерархия наследования

System.Object
  Microsoft.SqlServer.Management.Smo.SmoObjectBase
    Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Smo.Agent.AgentObjectBase
          Microsoft.SqlServer.Management.Smo.Agent.Alert

Пространство имен:  Microsoft.SqlServer.Management.Smo.Agent
Сборка:  Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)

Синтаксис

'Декларация
Public NotInheritable Class Alert _
    Inherits AgentObjectBase _
    Implements ICreatable, IDroppable, IAlterable, IRenamable,  _
    IScriptable
'Применение
Dim instance As Alert
public sealed class Alert : AgentObjectBase, 
    ICreatable, IDroppable, IAlterable, IRenamable, IScriptable
public ref class Alert sealed : public AgentObjectBase, 
    ICreatable, IDroppable, IAlterable, IRenamable, IScriptable
[<SealedAttribute>]
type Alert =  
    class 
        inherit AgentObjectBase 
        interface ICreatable 
        interface IDroppable 
        interface IAlterable 
        interface IRenamable 
        interface IScriptable 
    end
public final class Alert extends AgentObjectBase implements ICreatable, IDroppable, IAlterable, IRenamable, IScriptable

Тип Alert обеспечивает доступ к следующим элементам.

Конструкторы

  Имя Описание
Открытый метод Alert() Initializes a new instance of the Alert class.
Открытый метод Alert(JobServer, String) Initializes a new instance of the Alert class on the specified instance of SQL Server Agent and with the specified name

В начало

Свойства

  Имя Описание
Открытое свойство AlertType Gets the AlertType object value that specifies the type of alert.
Открытое свойство CategoryName Gets or sets the name of the category to which the alert belongs.
Открытое свойство CountResetDate Gets or sets the date on which to reset the alert occurrence count back to zero.
Открытое свойство DatabaseName Gets or sets the name of the database that the alert is monitoring.
Открытое свойство DelayBetweenResponses Gets or sets the delay between responses in seconds.
Открытое свойство EventDescriptionKeyword Gets or sets a word or phrase that must appear in the text of an event message that causes the alert to be raised.
Открытое свойство EventSource Gets the event source text from the application event log.
Открытое свойство HasNotification Gets the number of SQL Server Agent operators that are assigned to receive notification when the alert is fired.
Открытое свойство ID Gets the ID value that uniquely identifies SQL Server Agent.
Открытое свойство IncludeEventDescription Gets or sets the NotifyMethods object value that specifies the types of notification methods (e-mail, pager, or net send) that can contain alert error text.
Открытое свойство IsEnabled Gets or sets the Boolean property value that specifies whether the alert is enabled or not.
Открытое свойство JobID Gets or sets the ID value of the SQL Server Agent job that is run in response to the alert being raised.
Открытое свойство JobName Gets or sets the name of the SQL Server Agent job that is run in response to the alert being raised.
Открытое свойство LastOccurrenceDate Gets or sets the date on which the alert was last raised.
Открытое свойство LastResponseDate Gets or sets the date on which the alert last generated a response.
Открытое свойство MessageID Gets or sets the ID value of the Microsoft SQL Server message that causes the alert to be raised.
Открытое свойство Name Gets or sets the name of the object. (Производный от NamedSmoObject.)
Открытое свойство NotificationMessage Gets or sets the user-supplied text appended to any notification sent in response to an alert being raised.
Открытое свойство OccurrenceCount Gets the number of times the alert has fired since the alert was enabled or since a specified date.
Открытое свойство Parent Gets or sets the JobServer object that is the parent of the Alert object.
Открытое свойство PerformanceCondition Gets or sets the performance condition text.
Открытое свойство Properties Gets a collection of Property objects that represent the object properties. (Производный от SqlSmoObject.)
Открытое свойство Severity Gets or sets the error message severity level that causes the alert to be raised.
Открытое свойство State Gets the state of the referenced object. (Производный от SmoObjectBase.)
Открытое свойство Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Производный от SqlSmoObject.)
Открытое свойство UserData Gets or sets user-defined data associated with the referenced object. (Производный от SmoObjectBase.)
Открытое свойство WmiEventNamespace Gets or sets the Windows Management Instrumentation (WMI) namespace for the event.
Открытое свойство WmiEventQuery Gets or sets the Windows Management Instrumentation (WMI) query for the event.

В начало

Методы

  Имя Описание
Открытый метод AddNotification Designates an operator that receives a notification message when the alert is raised.
Открытый метод Alter Updates any Alert object property changes on instance of Microsoft SQL Server .
Открытый метод Create Creates an alert on the instance of Microsoft SQL Server as defined by the Alert object.
Открытый метод Discover Discovers a list of type Object. (Производный от SqlSmoObject.)
Открытый метод Drop Removes the alert.
Открытый метод EnumNotifications() Enumerates a list of all notifications defined on the alert.
Открытый метод EnumNotifications(String) Enumerates a list of notification methods defined on the alert that are restricted to the specified operator.
Открытый метод EnumNotifications(NotifyMethods) Enumerates a list of notification methods defined on the alert that are restricted to the specified notification methods.
Открытый метод EnumNotifications(NotifyMethods, String) Enumerates a list of notification methods defined on the alert that are restricted to the specified notification methods and a specified operator.
Открытый метод Equals (Производный от Object.)
Защищенный метод FormatSqlVariant Formats an object as SqlVariant type. (Производный от SqlSmoObject.)
Защищенный метод GetContextDB Gets the context database that is associated with this object. (Производный от SqlSmoObject.)
Защищенный метод GetDBName Gets the database name that is associated with the object. (Производный от AgentObjectBase.)
Открытый метод GetHashCode (Производный от Object.)
Защищенный метод GetPropValue Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptional Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetServerObject Gets the server of the SqlSmoObject object. (Производный от SqlSmoObject.)
Открытый метод GetType (Производный от Object.)
Открытый метод Initialize() Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Открытый метод Initialize(Boolean) Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInitialized Verifies whether the object has been initialized. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (Производный от SqlSmoObject.)
Открытый метод Refresh Refreshes the object and retrieves properties when the object is next accessed. (Производный от SqlSmoObject.)
Открытый метод RemoveNotification Removes the notification of an operator from the alert definition.
Открытый метод Rename Renames the alert.
Открытый метод ResetOccurrenceCount Resets the alert occurrence count back to zero.
Открытый метод Script() Generates a Transact-SQL script that can be used to re-create the Microsoft SQL Server Agent alert.
Открытый метод Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the Microsoft SQL Server Agent alert as specified by the scripting options.
Защищенный метод SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (Производный от SqlSmoObject.)
Открытый метод ToString Returns a String that represents the referenced object. (Производный от SqlSmoObject.)
Открытый метод UpdateNotification Changes the notification method associated with an operator for the alert.
Открытый метод Validate Validates the state of an object. (Производный от SmoObjectBase.)

В начало

События

  Имя Описание
Открытое событие PropertyChanged Represents the event that occurs when a property is changed. (Производный от SqlSmoObject.)
Открытое событие PropertyMetadataChanged Represents the event that occurs when property metadata changes. (Производный от SqlSmoObject.)

В начало

Явные реализации интерфейса

  Имя Описание
Явная реализация интерфейсаЗакрытый метод IAlienObject.Discover Discovers any dependencies. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetDomainRoot Returns the root of the domain. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetParent Gets the parent of this object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyType Gets the type of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyValue Gets the value of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetPropertyValue Sets the property value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Производный от SqlSmoObject.)

В начало

Замечания

To get or set Alert object properties, users must be a member of the sysadmin fixed server role.

To create or drop an Alert users must be a member of the sysadmin fixed server role.

Thread Safety

Все общие статические члены этого типа (Shared в Microsoft Visual Basic) можно использовать в многопоточных операциях. Потокобезопасная работа с членами экземпляров типа не гарантируется.

Примеры

Планирование автоматических административных задач в агенте SQL Server

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.

См. также

Справочник

Пространство имен Microsoft.SqlServer.Management.Smo.Agent

Другие ресурсы

Планирование автоматических административных задач в агенте SQL Server

Задачи автоматизированного администрирования (агент SQL Server)

sp_add_alert (Transact-SQL)