Prepare for your Next Interview
This is a discussion on what is a trigger? within the SQL Server forums, part of the Databases category; what is main difference between ddl trigger and dml trigger?...
|
|||
|
what is main difference between ddl trigger and dml trigger?
|
| The Following 5 Users Say Thank You to srinu.tenali For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: what is a trigger?
DDL tiggers are operate on Create, Drop,Alter and are useful to perform administrative tasks and enforce business rules.
DMl triggers are operate on Insert,Update,Delete and they are useful to enforce business rules and maintain data integrity when dml commands operate on tables(views). |
|
|||
|
A DML trigger is a stored procedure that goes into effect when you insert, delete, or update data in a table. You can use triggers to perform a number of automatic actions, such as cascading changes through related tables, enforcing column restrictions, comparing the results of data modifications, and maintaining the referential integrity of data across a database.
DML Triggers are automatic. They work no matter what caused the data modification. A trigger is specific to one or more of the data modification operations, update, insert, and delete and is executed once for each SQL statement. For example, to prevent users from removing any publishing companies from the publishers table, you could use this trigger: Thanks Shobi Last edited by shobi_at : 12-20-2007 at 12:31 AM. |
|
|||
|
Re: what is a trigger?
1.DDL triggers fire on execution of the dependent DDLs ,like create,alter or drop.
2.DMl triggers fire on execution of the dependent DMLs like insert,update,delete . |
|
|||
|
A trigger is a set of actionsthat are executed automatically whenever a specified event occurs to a specified base table. the event can be an insert,update or delete operation.
or we can say that a trigger is a set of actions that run automatically when a specified change or read operation is performed on a specified physical database file... |
| The Following User Says Thank You to shilpa.19in For This Useful Post: | ||
|
|||
|
Re: what is a trigger?
A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or UPDATE) occurs.
Triggers are stored in and managed by the DBMS.Triggers are used to maintain the referential integrity of data by changing the data in a systematic fashion. A trigger cannot be called or executed. DDL Triggers r operate on Crete,Drop,Alter. DML Triggers r operate on Insert,Update,Delete. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Which trigger will fires first? | JobHelper | SQL | 5 | 01-24-2008 07:54 AM |
| what is trigger | amaravadi11 | SQL | 8 | 01-23-2008 03:10 PM |
| schmitt trigger | cadelyhde | Electrical Engineering | 0 | 02-15-2007 10:00 AM |
| schmitt trigger | cadelyhde | Electrical Engineering | 0 | 02-15-2007 09:57 AM |
| mutating trigger | sudipta82 | Oracle | 1 | 02-08-2007 01:53 AM |