Results 1 to 12 of 12

Thread: what is a trigger?

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    18

    Post what is a trigger?

    what is main difference between ddl trigger and dml trigger?


  2. #2
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    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).


  3. #3
    Junior Member
    Join Date
    Dec 2007
    Answers
    1

    Thumbs up Re: what is a trigger?

    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 01:31 AM.

  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    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 .


  5. #5
    Junior Member
    Join Date
    Feb 2008
    Answers
    1

    Smile Re: what is a trigger?

    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...


  6. #6
    Junior Member
    Join Date
    Apr 2008
    Answers
    15

    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.


  7. #7
    Contributing Member
    Join Date
    Apr 2008
    Answers
    31

    Re: what is a trigger?

    Trigger is a automatic action which can fire when an action is performed.


  8. #8
    Junior Member
    Join Date
    May 2008
    Answers
    2

    Re: what is a trigger?

    Who we can know weather Trigger is fired or not.


  9. #9
    Junior Member
    Join Date
    Jul 2008
    Answers
    6

    Re: what is a trigger?

    Trigger is a event based action.
    whenever we perform insert,update and delete actions then it will fires automatically.


  10. #10
    Junior Member
    Join Date
    Jul 2008
    Answers
    1

    Re: what is a trigger?

    Triggers are the event based actions which are fired whenever the event on DDL and DML commands takes place


  11. #11
    Junior Member
    Join Date
    Feb 2008
    Answers
    5

    Re: what is a trigger?

    trigger mainly used to implement business rules, we can perform only DML operations in trigger, trigger is implicitly called by the database


  12. #12
    Junior Member
    Join Date
    Mar 2008
    Answers
    2

    Smile Re: what is a trigger?

    Triggers allow us to execute a batch of sql code when either an insert, update or delete command is executed against a specific table. Triggers fires automatically whereever there is any insert or delete based on your trigger. There is two types of triggers ddl trigger & dml triggers ddl trigger ---it stands for data defination language trigger. Triggers that fires on create,alter or drop statement is execute. Dml trigger ----it stands for data manipulation language trigger. Triggers that fires when there is any insert,delete or update trigger fires.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact