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?
Answer Posted / 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 |
Post New Answer View All Answers
What is single-user mode and what are the steps you should follow to start sql server in single-user mode?
Explain the cursor lock types?
How to find tables without indexes?
What are a database and a data warehouse?
How to write a query with a right outer join in ms sql server?
Explain nested join?
what is the difference between delete table and truncate table commands? : Sql server database administration
What is difference between index and primary key?
what is sql server? : Sql server database administration
can you implement data mining in SSRS?
What is the partitioning method?
What are the purposes and advantages stored procedure?
What happens when transaction log is full?
in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it
How exceptions can be handled in sql server programming?