sys.trace_categories (Transact-SQL)sys.trace_categories (Transact-SQL)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

将相似事件类按类别分组。Similar event classes are grouped by a category. Sys.trace_categories 目录视图中的每一行标识一个在服务器中唯一的类别。Each row in the sys.trace_categories catalog view identifies a category that is unique across the server. SQL Server 数据库引擎SQL Server Database Engine的给定版本中,这些类别不变。These categories do not change for a given version of the SQL Server 数据库引擎SQL Server Database Engine.

有关支持的跟踪事件的完整列表,请参阅 SQL Server 事件类引用For a complete list of supported trace events, see SQL Server Event Class Reference.

重要说明!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.

列名称Column name 数据类型Data type 说明Description
category_idcategory_id smallintsmallint 此类别的唯一 ID。Unique ID of this category. 此列也位于 " sys.trace_events 目录" 视图中。This column is also in the sys.trace_events catalog view.
name name nvarchar(128)nvarchar(128) 此类别的唯一名称。Unique name of this category. 此参数未本地化。This parameter is not localized.
type type tinyinttinyint 类别类型:Category type:

0 = 正常0 = Normal

1 = 连接1 = Connection

2 = 错误2 = Error

权限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.databases (Transact-sql) sys.traces (Transact-SQL)
sys.trace_columns (Transact-sql) sys.trace_columns (Transact-SQL)
sys.trace_events (Transact-sql) sys.trace_events (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)