Deadlocks

You can avoid deadlocks through the use of result sets and not modify the database directly. An example situation of where deadlocks could occur, is a stored procedure that inserts a record into the Events table and then immediately attempts to update it. There is a trigger defined on the events table that upon record insertion also attempts to update it. Subsequently, there is a situation where 2 statements simultaneously attempt to lock the record of update and it ends up in a deadlock.