Explain Trigger with an example?

Answer Posted / gopi

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; the DBMS automatically fires the trigger as a
result of a data modification to the associated table.
Triggers can be viewed as similar to stored procedures in
that both consist of procedural logic that is stored at the
database level. Stored procedures, however, are not event-
drive and are not attached to a specific table as triggers
are. Stored procedures are explicitly executed by invoking
a CALL to the procedure while triggers are implicitly
executed. In addition, triggers can also execute stored
procedures.

Is This Answer Correct ?    6 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of using a stored procedure?

556


What are “lost updates”?

609


What is the xml datatype?

619


Explain how many types of relationship?

569


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

565






Explain how to send email from sql database?

556


how we use window authentication connection with sql server.?

621


Your table has a large character field there are queries that use this field in their search clause what should you do?

499


What is the definition for sql server 2000?

580


What are the new scripting capabilities of ssms? : sql server management studio

545


how to invoke a trigger on demand? : Sql server database administration

563


Can you force a query to use a specific index?

524


What is table constraint?

539


In case you have filters in your report, when filters will be applied in cached report instance?

77


Difference between aggregate functions of sql?

649