DDL Triggers

DDL triggers allow you to respond to DDL events issued against the database server. You can use these triggers to roll back schema changes that don’t meet rules that you want to enforce, audit schema changes, or react to a schema change in a form that makes sense for your environment.

Note

Note

SQL Server supports only AFTER triggers for DDL. If you want a trigger to reject the schema change that caused it to fire you must issue a ROLLBACK TRAN command in the trigger.

You can create DDL triggers either at the database level or at the server (instance) level. You can create those for particular DDL statements (for example, CREATE TABLE) or for ...

Get Inside Microsoft® SQL Server™ 2005 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.