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

適用於: 是SQL Server 是Azure SQL Database 否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.

DATABASEDATABASE

OBJECT_OR_COLUMNOBJECT_OR_COLUMN
parent_idparent_id intint 觸發程序父系的識別碼,如下所示: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.

CLR_TRIGGERCLR_TRIGGER

SQL_TRIGGERSQL_TRIGGER
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.

PermissionsPermissions

目錄檢視內中繼資料的可見性會限制在使用者所擁有的安全性實體,或已授與使用者某些權限的安全性實體。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)