Compartir a través de


Clase Alert

The Alert class represents a Microsoft SQL Server Agent alert.

Jerarquía de herencia

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

Espacio de nombres:  Microsoft.SqlServer.Management.Smo.Agent
Ensamblado:  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Sintaxis

'Declaración
Public NotInheritable Class Alert _
    Inherits AgentObjectBase _
    Implements ICreatable, IDroppable, IAlterable, IRenamable,  _
    IScriptable
'Uso
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

El tipo Alert expone los siguientes miembros.

Constructores

  Nombre Descripción
Método público Alert() Initializes a new instance of the Alert class.
Método público Alert(JobServer, String) Initializes a new instance of the Alert class on the specified instance of SQL Server Agent and with the specified name

Arriba

Propiedades

  Nombre Descripción
Propiedad pública AlertType Gets the AlertType object value that specifies the type of alert.
Propiedad pública CategoryName Gets or sets the name of the category to which the alert belongs.
Propiedad pública CountResetDate Gets or sets the date on which to reset the alert occurrence count back to zero.
Propiedad pública DatabaseName Gets or sets the name of the database that the alert is monitoring.
Propiedad pública DelayBetweenResponses Gets or sets the delay between responses in seconds.
Propiedad pública 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.
Propiedad pública EventSource Gets the event source text from the application event log.
Propiedad pública HasNotification Gets the number of SQL Server Agent operators that are assigned to receive notification when the alert is fired.
Propiedad pública ID Gets the ID value that uniquely identifies SQL Server Agent.
Propiedad pública 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.
Propiedad pública IsEnabled Gets or sets the Boolean property value that specifies whether the alert is enabled or not.
Propiedad pública JobID Gets or sets the ID value of the SQL Server Agent job that is run in response to the alert being raised.
Propiedad pública JobName Gets or sets the name of the SQL Server Agent job that is run in response to the alert being raised.
Propiedad pública LastOccurrenceDate Gets or sets the date on which the alert was last raised.
Propiedad pública LastResponseDate Gets or sets the date on which the alert last generated a response.
Propiedad pública MessageID Gets or sets the ID value of the Microsoft SQL Server message that causes the alert to be raised.
Propiedad pública Name Gets or sets the name of the object. (Se hereda de NamedSmoObject.)
Propiedad pública NotificationMessage Gets or sets the user-supplied text appended to any notification sent in response to an alert being raised.
Propiedad pública OccurrenceCount Gets the number of times the alert has fired since the alert was enabled or since a specified date.
Propiedad pública Parent Gets or sets the JobServer object that is the parent of the Alert object.
Propiedad pública PerformanceCondition Gets or sets the performance condition text.
Propiedad pública Properties Gets a collection of Property objects that represent the object properties. (Se hereda de SqlSmoObject.)
Propiedad pública Severity Gets or sets the error message severity level that causes the alert to be raised.
Propiedad pública State Gets the state of the referenced object. (Se hereda de SmoObjectBase.)
Propiedad pública Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Se hereda de SqlSmoObject.)
Propiedad pública UserData Gets or sets user-defined data associated with the referenced object. (Se hereda de SmoObjectBase.)
Propiedad pública WmiEventNamespace Gets or sets the Windows Management Instrumentation (WMI) namespace for the event.
Propiedad pública WmiEventQuery Gets or sets the Windows Management Instrumentation (WMI) query for the event.

Arriba

Métodos

  Nombre Descripción
Método público AddNotification Designates an operator that receives a notification message when the alert is raised.
Método público Alter Updates any Alert object property changes on instance of Microsoft SQL Server .
Método público Create Creates an alert on the instance of Microsoft SQL Server as defined by the Alert object.
Método público Discover Discovers a list of type Object. (Se hereda de SqlSmoObject.)
Método público Drop Removes the alert.
Método público EnumNotifications() Enumerates a list of all notifications defined on the alert.
Método público EnumNotifications(String) Enumerates a list of notification methods defined on the alert that are restricted to the specified operator.
Método público EnumNotifications(NotifyMethods) Enumerates a list of notification methods defined on the alert that are restricted to the specified notification methods.
Método público 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.
Método público Equals (Se hereda de Object.)
Método protegido FormatSqlVariant Formats an object as SqlVariant type. (Se hereda de SqlSmoObject.)
Método protegido GetContextDB Gets the context database that is associated with this object. (Se hereda de SqlSmoObject.)
Método protegido GetDBName Gets the database name that is associated with the object. (Se hereda de AgentObjectBase.)
Método público GetHashCode (Se hereda de Object.)
Método protegido GetPropValue Gets a property value of the SqlSmoObject object. (Se hereda de SqlSmoObject.)
Método protegido GetPropValueOptional Gets a property value of the SqlSmoObject object. (Se hereda de SqlSmoObject.)
Método protegido GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Se hereda de SqlSmoObject.)
Método protegido GetServerObject Gets the server of the SqlSmoObject object. (Se hereda de SqlSmoObject.)
Método público GetType (Se hereda de Object.)
Método público Initialize() Initializes the object and forces the properties be loaded. (Se hereda de SqlSmoObject.)
Método público Initialize(Boolean) Initializes the object and forces the properties be loaded. (Se hereda de SqlSmoObject.)
Método protegido IsObjectInitialized Verifies whether the object has been initialized. (Se hereda de SqlSmoObject.)
Método protegido IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (Se hereda de SqlSmoObject.)
Método público Refresh Refreshes the object and retrieves properties when the object is next accessed. (Se hereda de SqlSmoObject.)
Método público RemoveNotification Removes the notification of an operator from the alert definition.
Método público Rename Renames the alert.
Método público ResetOccurrenceCount Resets the alert occurrence count back to zero.
Método público Script() Generates a Transact-SQL script that can be used to re-create the Microsoft SQL Server Agent alert.
Método público 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.
Método protegido SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (Se hereda de SqlSmoObject.)
Método público ToString Returns a String that represents the referenced object. (Se hereda de SqlSmoObject.)
Método público UpdateNotification Changes the notification method associated with an operator for the alert.
Método público Validate Validates the state of an object. (Se hereda de SmoObjectBase.)

Arriba

Eventos

  Nombre Descripción
Evento público PropertyChanged Represents the event that occurs when a property is changed. (Se hereda de SqlSmoObject.)
Evento público PropertyMetadataChanged Represents the event that occurs when property metadata changes. (Se hereda de SqlSmoObject.)

Arriba

Implementaciones de interfaces explícitas

  Nombre Descripción
Implementación de interfaces explícitasMétodo privado IAlienObject.Discover Discovers any dependencies. No haga referencia directamente a este miembro en el código. Admite la infraestructura de SQL Server. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.GetDomainRoot Returns the root of the domain. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.GetParent Gets the parent of this object. No haga referencia directamente a este miembro en el código. Admite la infraestructura de SQL Server. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.GetPropertyType Gets the type of the specified property. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.GetPropertyValue Gets the value of the specified property. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. No haga referencia directamente a este miembro en el código. Admite la infraestructura de SQL Server. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado IAlienObject.SetPropertyValue Sets the property value. (Se hereda de SqlSmoObject.)
Implementación de interfaces explícitasMétodo privado ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Se hereda de SqlSmoObject.)

Arriba

Comentarios

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

Todos los miembros estáticos (compartidos en Microsoft Visual Basic) públicos de este tipo son seguros para operaciones multiproceso. No se garantiza que los miembros de instancia sean seguros para subprocesos.

Ejemplos

Programar tareas administrativas automáticas en el Agente SQL Server

Seguridad para subprocesos

Cualquier miembro público static (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancia sean seguros para subprocesos.

Vea también

Referencia

Espacio de nombres Microsoft.SqlServer.Management.Smo.Agent

Otros recursos

Programar tareas administrativas automáticas en el Agente SQL Server

Tareas administrativas automatizadas (Agente SQL Server)

sp_add_alert (Transact-SQL)