What are DDL Triggers?
DDL Triggers has the similar behavior as the DML triggers to have except that they are fired in response to a DDL type event like Alter command, Drop command and Create commands. In other words, it will fire in response to the events which try to change the schema of the database. Therefore, these triggers are not created for a particular table, but they are applicable to all the tables on the database. Also DDL triggers can be fired only after the commands which make them fire is executed. They can be used for the following purposes:
1) To prevent any changes to the database Schema
2) If we want to store the records of all the events, which change the database schema.
SQL Server Interview Questions · · · ·