DDL and DML triggers

DDL and DML triggers

In SQL Server 2008, triggers are special types of stored procedures that are automatically executed in response to certain events occurring in the database. There are two types of triggers: DDL (Data Definition Language) triggers and DML (Data Manipulation Language) triggers.

DDL triggers are used to monitor and respond to changes to the database schema, such as table creation, modification or deletion. They can be used to enforce business rules or to audit database changes. DDL triggers are created at the database level and are fired before or after a DDL statement is executed.

On the other hand, DML triggers are used to monitor and respond to changes to the data in a table, such as insert, update or delete operations. They can be used to validate data, enforce business rules, or audit changes. DML triggers are created on a specific table and are fired before or after a DML statement is executed. Both types of triggers can be used to enforce data integrity, enhance security, and ensure consistency in the database. However, it’s important to use triggers judiciously as they can have a performance impact on the database.

Apply for SQL Server 2008 Certification!!

https://www.vskills.in/certification/certified-sql-server-2008-programmer

Back to Tutorials

Create and execute triggers
Optimization

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?