Share via


Event Groups for Use with DDL Triggers

The following diagram lists the event groups that can be used to fire a DDL trigger, the Transact-SQL statements that they cover, and the scope at which they can be programmed (ON SERVER or ON DATABASE). Note the inclusive nature of the event groups, as indicated by the tree structure. For example, a DDL trigger that specifies FOR DDL_TABLE_EVENTS covers the CREATE TABLE, ALTER TABLE, and DROP TABLE Transact-SQL statements, and a DDL trigger that specifies FOR DDL_TABLE_VIEW_EVENTS covers all Transact-SQL statements under DDL_TABLE_EVENTS, DDL_VIEW_EVENTS, DDL_INDEX_EVENTS, and DDL_STATISTICS_EVENTS.

Important

Certain system stored procedures that perform DDL-like operations can also fire DDL triggers. Test your DDL triggers to determine their responses to system stored procedures that are run. For example, the CREATE TYPE statement and sp_addtype stored procedure will both fire a DDL trigger that is created on a CREATE_TYPE event. However, the sp_rename stored procedure does not fire any DDL triggers.

DDL event groups for use with DDL triggers

See Also

Concepts

Designing DDL Triggers

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

14 April 2006

New content:
  • Added an important note that recommends testing DDL triggers to determine their responses to stored procedure that are executed.