Interview Question in SQL Server Triggers


 

Interview Question :: I have a trigger on table1 for update. Can this trigger update table1 too? Does it cause Deadlock


I am using SQL Server 2000.
Answers to "I have a trigger on table1 for update. Can this trigger update table1 too? Does it cause Deadlock"
RE: I have a trigger on table1 for update. Can this trigger update table1 too? Does it cause Deadlock?

Triggers are evil and should be avoided at all costs. Try to find another way to accomplish the task
 
Vote for this answer ::  
RE: I have a trigger on table1 for update. Can this trigger update table1 too? Does it cause Deadlock?

You should be fine, this sort of behavior is normal. However, if the target field is always a reflection of some other field you may want to consider using a computed field instead.
 
Vote for this answer ::  
RE: I have a trigger on table1 for update. Can this trigger update table1 too? Does it cause Deadlock?

Well trigger on a particular table are many times for the same table.. as for example: if we update positioln of employee then salary must be updated this trigger shall not coz a deadlock.
 
Vote for this answer ::  
Update Alert Setting