what are DDL Triggers? Create a trigger to prevent a user to delete a table in the database.
Jr. Software Developer
I am a software developer at MindStick soft. Pvt. ltd. I joined this company in august 2021 after completing my post-graduation course. I love to see the historical places of my country.
Data Definition Language (DDL) triggers are fired in response to events caused by DDL statements like CREATE, ALTER, and DROP. These can be created at either the database level or server level, and can also be triggered by system-defined stored procedures that execute actions similar to DDL statements.
These triggers are helpful because:
1. sometimes it is necessary to avoid altering the database schema.
2. sometimes it is necessary to review database schema modifications.
3. sometimes we must respond to a modification made in the database schema.
An example of a DDL trigger that prevents the user from deleting a table in a database would be as follows: