sys.triggers (Transact-SQL)sys.triggers (Transact-SQL)

适用于: 是SQL Server是Azure SQL 数据库否Azure SQL 数据仓库否并行数据仓库APPLIES TO: yesSQL Server yesAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

每个类型为 TR 或 TA 的触发器对象对应一行。Contains a row for each object that is a trigger, with a type of TR or TA. DML 触发器名称是架构范围内,并且因此,是在可见sys.objectsDML trigger names are schema-scoped and, therefore, are visible in sys.objects. DDL 触发器名称的作用域取决于父实体,只能在此视图中显示。DDL trigger names are scoped by the parent entity and are only visible in this view.

Parent_class名称列唯一标识数据库中的触发器。The parent_class and name columns uniquely identify the trigger in the database.

列名Column name 数据类型Data type 描述Description
namename sysnamesysname 触发器名称。Trigger name. DML 触发器名称的架构范围。DML trigger names are schema-scoped. DDL 触发器名称的作用域取决于父实体。DDL trigger names are scoped with respect to the parent entity.
object_idobject_id intint 对象标识号。Object identification number. 是在数据库中唯一。Is unique within a database.
parent_classparent_class tinyinttinyint 触发器的父类。Class of the parent of the trigger.

0 = DDL 触发器的数据库。0 = Database, for the DDL triggers.

1 = DML 触发器的对象或列。1 = Object or column for the DML triggers.
parent_class_descparent_class_desc nvarchar(60)nvarchar(60) 触发器的父类的说明。Description of the parent class of the trigger.


parent_idparent_id intint 触发器的父实体的 ID,如下所示:ID of the parent of the trigger, as follows:

0 = 父实体为数据库的触发器。0 = Triggers that are database-parented triggers.

对于 DML 触发器,这是object_id的表或在其定义的 DML 触发器的视图。For DML triggers, this is the object_id of the table or view on which the DML trigger is defined.
typetype char(2)char(2) 对象类型:Object type:

TA = 程序集 (CLR) 触发器TA = Assembly (CLR) trigger

TR = SQL 触发器TR = SQL trigger
type_desctype_desc nvarchar(60)nvarchar(60) 对象类型的说明。Description of object type.


create_datecreate_date datetimedatetime 触发器的创建日期。Date the trigger was created.
modify_datemodify_date datetimedatetime 上次使用 ALTER 语句修改对象的日期。Date the object was last modified by using an ALTER statement.
is_ms_shippedis_ms_shipped bitbit 由内部 SQL ServerSQL Server 组件代表用户创建的触发器。Trigger created on behalf of the user by an internal SQL ServerSQL Server component.
is_disabledis_disabled bitbit 触发器被禁用。Trigger is disabled.
is_not_for_replicationis_not_for_replication bitbit 触发器是作为 NOT FOR REPLICATION 创建的。Trigger was created as NOT FOR REPLICATION.
is_instead_of_triggeris_instead_of_trigger bitbit 1 = INSTEAD OF 触发器。1 = INSTEAD OF triggers

0 = AFTER 触发器。0 = AFTER triggers.


目录视图中仅显示用户拥有的安全对象的元数据,或用户对其拥有某些权限的安全对象的元数据。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) Security Catalog Views (Transact-SQL)
目录视图 (Transact-SQL)Catalog Views (Transact-SQL)