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

How to change the system date and time from SQL Plus Terminal ?

899


Explain the microsoft sql server delete command?

729


How to drop an existing schema in ms sql server?

784


what is the sql equivaent of the dataset relation object ?

1757


Is sql server difficult to learn?

709


i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1619


List all the types of user-defined functions?

710


What are system databases into sql server (2005/2008)?

782


How to create hyperlink from returned sql query ?

855


How to list all field names in the result set using mssql_field_name()?

702


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1807


What are horizontal and vertical scaling?

166


What are “lock” hints?

791


Can you create a logon trigger in sql server 2005 express edition?

838


How to delete duplicate records based on single column from a table?

809