ServerEvents ServerEvents ServerEvents Class

Definition

The ServerEvents object represents the settings required for SQL Server server-level event notification.

public ref class ServerEvents sealed
public sealed class ServerEvents
Public NotInheritable Class ServerEvents
Inheritance
ServerEventsServerEventsServerEvents

Examples

Handling SMO Events

Remarks

The ServerEvents class is accessed through Events property and cannot be created as a stand-alone object.

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.

Methods

GetEventSelection() GetEventSelection() GetEventSelection()

Returns the currently selected event notifications.

GetTraceEventSelection() GetTraceEventSelection() GetTraceEventSelection()

Returns the currently selected event notifications.

SetCredentials(String, String) SetCredentials(String, String) SetCredentials(String, String)

Sets the credentials required by the instance of Microsoft SQL Server.

StartEvents() StartEvents() StartEvents()

Starts receiving events.

StopEvents() StopEvents() StopEvents()

Stops receiving events.

SubscribeToEvents(ServerEventSet) SubscribeToEvents(ServerEventSet) SubscribeToEvents(ServerEventSet)

Specifies the server events to receive.

SubscribeToEvents(ServerTraceEventSet) SubscribeToEvents(ServerTraceEventSet) SubscribeToEvents(ServerTraceEventSet)

Specifies the server trace events to receive.

SubscribeToEvents(ServerEventSet, ServerEventHandler) SubscribeToEvents(ServerEventSet, ServerEventHandler) SubscribeToEvents(ServerEventSet, ServerEventHandler)

Specifies the server events to receive and the event handler that handles the events.

SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) SubscribeToEvents(ServerTraceEventSet, ServerEventHandler)

Specifies the server trace events to receive and the event handler that handles the events.

UnsubscribeAllEvents() UnsubscribeAllEvents() UnsubscribeAllEvents()

Clears all event settings, and removes all event handlers.

UnsubscribeFromEvents(ServerEventSet) UnsubscribeFromEvents(ServerEventSet) UnsubscribeFromEvents(ServerEventSet)

Clears the specified event settings, and removes all event handlers.

UnsubscribeFromEvents(ServerTraceEventSet) UnsubscribeFromEvents(ServerTraceEventSet) UnsubscribeFromEvents(ServerTraceEventSet)

Clears the specified event settings, and removes all event handlers.

Events

ServerEvent ServerEvent ServerEvent

Specifies the event raised when an event occurs in Server object and the user has subscribed to the events from that object instance.

Applies to