ServerEvents 類別
The ServerEvents object represents the settings required for SQL Server server-level event notification.
繼承階層
System.Object
Microsoft.SqlServer.Management.Smo.ServerEvents
命名空間: Microsoft.SqlServer.Management.Smo
組件: Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)
語法
'宣告
Public NotInheritable Class ServerEvents
'用途
Dim instance As ServerEvents
public sealed class ServerEvents
public ref class ServerEvents sealed
[<SealedAttribute>]
type ServerEvents = class end
public final class ServerEvents
ServerEvents 型別公開下列成員。
方法
名稱 | 說明 | |
---|---|---|
Equals | (繼承自 Object。) | |
GetEventSelection | Returns the currently selected event notifications. | |
GetHashCode | (繼承自 Object。) | |
GetTraceEventSelection | Returns the currently selected event notifications. | |
GetType | (繼承自 Object。) | |
SetCredentials | Sets the credentials required by the instance of Microsoft SQL Server. | |
StartEvents | Starts receiving events. | |
StopEvents | Stops receiving events. | |
SubscribeToEvents(ServerEventSet) | Specifies the server events to receive. | |
SubscribeToEvents(ServerTraceEventSet) | Specifies the server trace events to receive. | |
SubscribeToEvents(ServerEventSet, ServerEventHandler) | Specifies the server events to receive and the event handler that handles the events. | |
SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) | Specifies the server trace events to receive and the event handler that handles the events. | |
ToString | (繼承自 Object。) | |
UnsubscribeAllEvents | Clears all event settings, and removes all event handlers. | |
UnsubscribeFromEvents(ServerEventSet) | Clears the specified event settings, and removes all event handlers. | |
UnsubscribeFromEvents(ServerTraceEventSet) | Clears the specified event settings, and removes all event handlers. |
上層
事件
名稱 | 說明 | |
---|---|---|
ServerEvent | Specifies the event raised when an event occurs in Server object and the user has subscribed to the events from that object instance. |
上層
備註
The ServerEvents class is accessed through Events property and cannot be created as a stand-alone object.
Thread Safety
此型別的任何公用靜態 (在 Microsoft Visual Basic 為共用) 成員具備多執行緒作業安全。並非所有的執行個體成員都是安全執行緒。
範例
執行緒安全性
這個型別的任何公用 static (在 Visual Basic 中為 Shared) 成員都是執行緒安全的。並不是所有的執行個體成員都保證可以用於所有的執行緒。