|
What is the difference between DDL and regular triggers? I keep seeing these terms in Books Online.
(comments are locked)
|
|
A DDL trigger is something that works on changes to the schema of a database. They are scoped against the database. There are also server event/logon triggers, which work on extended events and are scopes against the server. A 'regular' trigger is a DML trigger, and executes either 'AFTER' or 'INSTEAD OF' an UPDATE, DELETE or INSERT statement, or any combination of the three. A big difference is the way that the triggers deal with their scope data - DML triggers use the virtual table monikers 'inserted' and 'deleted' to reference the new and old values of data, respectively. DDL/server event/logon triggers use the EVENTDATA function to retrieve information about what happened.
(comments are locked)
|
|
A nice quick article from MSDN on Understanding DDL Triggers vs DML Triggers:
(comments are locked)
|

