Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Which is better in performance - CONSTRAINT or TRIGGER over
a column which restricts say an input of particular value
in a column of a table?

Answers were Sorted based on User's Feedback



Which is better in performance - CONSTRAINT or TRIGGER over a column which restricts say an input ..

Answer / jerry joseph

Restricting the input using CONSTRAINT will have better
performance but there is a limit to the types of constraints
which we can provide..

With TRIGGERS you have more flexibility and provide a more
variety restrictions to the input.. for example you can
prevent a normal delete and make it a soft delete by setting
an IsDeleted flag using trigger.. we cant have that kind of
flexibility using Constraints..

Is This Answer Correct ?    6 Yes 1 No

Which is better in performance - CONSTRAINT or TRIGGER over a column which restricts say an input ..

Answer / monal

Constraints gets evaluated before statement can be either
inserted or deleted or updated. While trigger executes
after or at the same time statement is executing. So if you
have to roll back transactio because transaction not
meeting condition there is no overhead when you are using
constraint ,but if you have to roll back transaction and
you have a trigger on that table or column either 1
transaction goes through before rolling back. So basically
trigger consumes more resources.

Is This Answer Correct ?    7 Yes 3 No

Which is better in performance - CONSTRAINT or TRIGGER over a column which restricts say an input ..

Answer / guest

Constraint is better in terms of performance for same
operation. Why??

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL Server Interview Questions

how many types of store procedre in sqlserver 2000?

2 Answers   ATI,


How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?

0 Answers  


What is log shipping? Can we do logshipping with SQL Server 7.0 ?

0 Answers   IBM,


What is mean by "fill factor" ? and what is mean by "Index "in sql?

1 Answers   iGate, Logica CMG,


What is normalization and its forms?

4 Answers   Challenger Financial,


What is t-sql script to take database offline – take database online.

0 Answers  


How do I find my localdb version?

0 Answers  


Where are sql server usernames and passwords stored in the sql server?

0 Answers  


Can we use custom code in ssrs?

0 Answers  


What is a View ? Can we insert, Update and delete a view?

0 Answers   Arigo Infotech,


What is the difference between update lock and exclusive lock?

0 Answers  


What is microsoft sql server?

0 Answers  


Categories