What is the diffrence between and constraints and triggers?

Showing Answers 1 - 24 of 24 Answers

Sunil

  • Sep 9th, 2005
 

Constraints are used to maintain the integrity and atomicity of database .in other words it can be said they are used to prevent invalid data entry . the main 5 constraints are  
NOT NULL,PRIMARY KEY,FOREIGN KEY,UNIQUE KEY and CHECK  
 
Triggers are bascically stored procedures which automaticallly fired when any insert,update or delete is issued on table

krishnaveni

  • Sep 29th, 2005
 

Generally we cant compare between and constraintsbut the difference between constraints and triggers is already there see.

  Was this answer useful?  Yes

Piyushjohn

  • May 4th, 2006
 

Triggers - They start a chain reaction- for instance each delete, update action etc. can trigger off another function

Contstraint is set when the application is customized so that there are restrictions to the data entered, so that the data is authentic.

  Was this answer useful?  Yes

RamaKrishna Yerra,TCS,Hyd,9989018508

  • Aug 31st, 2006
 

Both are used for Business Rules...

           But the major diff is... Triggers can nt fire on the Pre-Loaded data inthe table where as Constraints can be..

Thanks&Regds

RamaKrishna Yerra,TCS,Hyd,9989018508   

  Was this answer useful?  Yes

Ashish

  • Sep 7th, 2006
 

Triggers are used to carry out tasks which cant be done using constraints.

For eg:-A change in the "sal" column of a table should change the "tax" column in another table.This cant be done using constraints.It has to be done using triggers.Thats where the importance of triggers lie.

  Was this answer useful?  Yes

anil kumar

  • Aug 2nd, 2007
 

Constraints are the conditions it can set while creating the table. To eliminate duplicates, not null values and also check the conditions..
Triggers are used when the event occurs.

  Was this answer useful?  Yes

sankar babu

  • May 25th, 2011
 

1.constraints are oracles predefined business rules.but triggers are user defined business rules.

2.constraints validates the data immediately but triggers validates the data when event occurs.

  Was this answer useful?  Yes

z_ashwini

  • Jan 13th, 2012
 

Contraints can be enforced on DB table to enforce intergrity or uniqueness on a table. Specfically it it a bussiness rule used to validate data. Type of Constraints are: Primay key, Foreign Key, Unique key, Check constraint...
Triggers are DB object that is validated when an event occurs.
Type of triggers are :
Row level triggers
Statement level Triggers
Schema level triggers
DB triggers

  Was this answer useful?  Yes

Chittaranjan Kotian

  • May 16th, 2012
 

Constraints and triggers are both used to enforce business rules at the database level. Constraints are primary key, unique key, foreign key, not null contraints etc, while triggers can be defined at the database and table level to do certain tasks depending on data entered

  Was this answer useful?  Yes

vishnuvardhanarao

  • Nov 14th, 2012
 

Check constraints it cant work multiple tables

  Was this answer useful?  Yes

rc

  • Aug 15th, 2014
 

CONSTRAINTS:=

1.it will check the existing data and feature data.
2.we cant change the constraint behavior these are predefined.
3.constraint are not support the object tables.
4.constraints can create on table,view and define on variables also(default,not null).


Trigger:=

1.It evaluates feature data.
2.we can change the trigger behavior
3.Trigger supports the object tables.
4.trigger are created only on table,view

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions