Export (0) Print
Expand All

Alert Class

The Alert class represents a Microsoft SQL Server Agent alert.

Namespace:  Microsoft.SqlServer.Management.Smo.Agent
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public sealed class Alert : AgentObjectBase, 
	ICreatable, IDroppable, IAlterable, IRenamable, IScriptable

The Alert type exposes the following members.

  NameDescription
Public methodAlert()Initializes a new instance of the Alert class.
Public methodAlert(JobServer, String)Initializes a new instance of the Alert class on the specified instance of SQL Server Agent and with the specified name
Top

  NameDescription
Public propertyAlertTypeGets the AlertType object value that specifies the type of alert.
Public propertyCategoryNameGets or sets the name of the category to which the alert belongs.
Public propertyCountResetDateGets or sets the date on which to reset the alert occurrence count back to zero.
Public propertyDatabaseNameGets or sets the name of the database that the alert is monitoring.
Public propertyDelayBetweenResponsesGets or sets the delay between responses in seconds.
Public propertyEventDescriptionKeywordGets or sets a word or phrase that must appear in the text of an event message that causes the alert to be raised.
Public propertyEventSourceGets the event source text from the application event log.
Public propertyHasNotificationGets the number of SQL Server Agent operators that are assigned to receive notification when the alert is fired.
Public propertyIDGets the ID value that uniquely identifies SQL Server Agent.
Public propertyIncludeEventDescriptionGets 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.
Public propertyIsEnabledGets or sets the Boolean property value that specifies whether the alert is enabled or not.
Public propertyJobIDGets or sets the ID value of the SQL Server Agent job that is run in response to the alert being raised.
Public propertyJobNameGets or sets the name of the SQL Server Agent job that is run in response to the alert being raised.
Public propertyLastOccurrenceDateGets or sets the date on which the alert was last raised.
Public propertyLastResponseDateGets or sets the date on which the alert last generated a response.
Public propertyMessageIDGets or sets the ID value of the Microsoft SQL Server message that causes the alert to be raised.
Public propertyNameGets or sets the name of the object. (Inherited from NamedSmoObject.)
Public propertyNotificationMessageGets or sets the user-supplied text appended to any notification sent in response to an alert being raised.
Public propertyOccurrenceCountGets the number of times the alert has fired since the alert was enabled or since a specified date.
Public propertyParentGets or sets the JobServer object that is the parent of the Alert object.
Public propertyPerformanceConditionGets or sets the performance condition text.
Public propertyPropertiesGets a collection of Property objects that represent the object properties. (Inherited from SqlSmoObject.)
Public propertySeverityGets or sets the error message severity level that causes the alert to be raised.
Public propertyStateGets the state of the referenced object. (Inherited from SmoObjectBase.)
Public propertyUrnGets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Inherited from SqlSmoObject.)
Public propertyUserDataGets or sets user-defined data associated with the referenced object. (Inherited from SmoObjectBase.)
Public propertyWmiEventNamespaceGets or sets the Windows Management Instrumentation (WMI) namespace for the event.
Public propertyWmiEventQueryGets or sets the Windows Management Instrumentation (WMI) query for the event.
Top

  NameDescription
Public methodAddNotificationDesignates an operator that receives a notification message when the alert is raised.
Public methodAlterUpdates any Alert object property changes on instance of Microsoft SQL Server .
Public methodCreateCreates an alert on the instance of Microsoft SQL Server as defined by the Alert object.
Public methodDiscoverDiscovers a list of type Object. (Inherited from SqlSmoObject.)
Public methodDropRemoves the alert.
Public methodEnumNotifications()Enumerates a list of all notifications defined on the alert.
Public methodEnumNotifications(String)Enumerates a list of notification methods defined on the alert that are restricted to the specified operator.
Public methodEnumNotifications(NotifyMethods)Enumerates a list of notification methods defined on the alert that are restricted to the specified notification methods.
Public methodEnumNotifications(NotifyMethods, String)Enumerates a list of notification methods defined on the alert that are restricted to the specified notification methods and a specified operator.
Public methodEquals (Inherited from Object.)
Protected methodFormatSqlVariantFormats an object as SqlVariant type. (Inherited from SqlSmoObject.)
Protected methodGetContextDBGets the context database that is associated with this object. (Inherited from SqlSmoObject.)
Protected methodGetDBNameGets the database name that is associated with the object. (Inherited from AgentObjectBase.)
Public methodGetHashCode (Inherited from Object.)
Protected methodGetPropValueGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetPropValueOptionalGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetPropValueOptionalAllowNullGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetServerObjectGets the server of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Public methodGetType (Inherited from Object.)
Public methodInitialize()Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Public methodInitialize(Boolean)Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Protected methodIsObjectInitializedVerifies whether the object has been initialized. (Inherited from SqlSmoObject.)
Protected methodIsObjectInSpaceVerifies whether the object is isolated or connected to the instance of SQL Server. (Inherited from SqlSmoObject.)
Public methodRefreshRefreshes the object and retrieves properties when the object is next accessed. (Inherited from SqlSmoObject.)
Public methodRemoveNotificationRemoves the notification of an operator from the alert definition.
Public methodRenameRenames the alert.
Public methodResetOccurrenceCountResets the alert occurrence count back to zero.
Public methodScript()Generates a Transact-SQL script that can be used to re-create the Microsoft SQL Server Agent alert.
Public methodScript(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.
Protected methodSetParentImplSets the parent of the SqlSmoObject to the newParent parameter. (Inherited from SqlSmoObject.)
Public methodToStringReturns a String that represents the referenced object. (Inherited from SqlSmoObject.)
Public methodUpdateNotificationChanges the notification method associated with an operator for the alert.
Public methodValidateValidates the state of an object. (Inherited from SmoObjectBase.)
Top

  NameDescription
Public eventPropertyChangedRepresents the event that occurs when a property is changed. (Inherited from SqlSmoObject.)
Public eventPropertyMetadataChangedRepresents the event that occurs when property metadata changes. (Inherited from SqlSmoObject.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIAlienObject.DiscoverDiscovers any dependencies. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetDomainRootReturns the root of the domain. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetParentGets the parent of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetPropertyTypeGets the type of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetPropertyValueGets the value of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetUrnGets the Unified Resource Name (URN) of the object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.ResolveGets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.SetObjectStateSets the object state to the specified SfcObjectState value. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.SetPropertyValueSets the property value. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodISfcPropertyProvider.GetPropertySetGets the interface reference to the set of properties of this object. (Inherited from SqlSmoObject.)
Top

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

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft