Home > DeveloperSection > Interviews > What is a "trigger"?

Posted on    October-25-2010 12:00 AM

 MSSQL Server MSSQL Server 
Ratings:
 1 Answer(s)
  1081  View(s)
Rate this:

Pushpendra Singh

Total Post:241

Points:1205
Posted on    November-01-2010 12:00 AM

Triggers are stored procedures created in order to enforce integrity rules in a database. A trigger is executed every time a data-modification operation occurs (i.e., insert, update or delete). Triggers are executed automatically on occurance of one of the data-modification operations. A trigger is a database object directly associated with a particular table. It fires whenever a specific statement/type of statement is issued against that table. The types of statements are insert,update,delete and query statements. Basically, trigger is a set of SQL statements A trigger is a solution to the restrictions of a constraint. For instance: 1.A database column cannot carry PSEUDO columns as criteria where a trigger can. 2. A database constraint cannot refer old and new values for a row where a trigger can.

Don't want to miss updates? Please click the below button!

Follow MindStick