sys.trace_events (Transact-SQL)sys.trace_events (Transact-SQL)

適用範圍:Applies to: 是SQL ServerSQL Server (所有支援的版本) yesSQL ServerSQL Server (all supported versions) 適用範圍:Applies to: 是SQL ServerSQL Server (所有支援的版本) yesSQL ServerSQL Server (all supported versions)

Sys. trace_events目錄檢視包含所有 SQL 追蹤事件的清單。The sys.trace_events catalog view contains a list of all SQL trace events. SQL Server Database EngineSQL Server Database Engine 給定版本的這些追蹤事件不會改變。These trace events do not change for a given version of the SQL Server Database EngineSQL Server Database Engine.

重要!IMPORTANT! 未來的 Microsoft SQL Server 版本將移除這項功能。This feature will be removed in a future version of Microsoft SQL Server. 請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。Avoid using this feature in new development work, and plan to modify applications that currently use this feature.請改用擴充事件目錄檢視。Use Extended Event catalog views instead.

如需有關這些追蹤事件的詳細資訊,請參閱 SQL Server 事件類別參考For more information about these trace events, see SQL Server Event Class Reference.

資料行名稱Column name 資料類型Data type 描述Description
trace_event_idtrace_event_id smallintsmallint 事件的唯一識別碼。Unique ID of the event. 這個資料行也在 sys. trace_event_bindingssys. trace_subclass_values 目錄檢視中。This column is also in the sys.trace_event_bindings and sys.trace_subclass_values catalog views.
category_idcategory_id smallintsmallint 事件的類別目錄識別碼。Category ID of the event. 這個資料行也在 sys. trace_categories 目錄檢視中。This column is also in the sys.trace_categories catalog view.
namename nvarchar(128)nvarchar(128) 這個事件的唯一名稱。Unique name of this event. 這個參數未翻譯成當地語系。This parameter is not localized.

權限Permissions

目錄檢視內中繼資料的可見性會限制在使用者所擁有的安全性實體,或已授與使用者某些權限的安全性實體。The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. 如需相關資訊,請參閱 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.

另請參閱See also

物件目錄檢視 (Transact-SQL) Object Catalog Views (Transact-SQL)
sys. 追蹤 (Transact-sql) sys.traces (Transact-SQL)
sys. trace_categories (Transact-sql) sys.trace_categories (Transact-SQL)
sys. trace_columns (Transact-sql) sys.trace_columns (Transact-SQL)
sys. trace_event_bindings (Transact-sql) sys.trace_event_bindings (Transact-SQL)
sys. trace_subclass_values (Transact-sql)sys.trace_subclass_values (Transact-SQL)