One of the common problem the database developers face in their day to day life is record concurrency issues. Lets try to address that with the help of timestamp data type. Lets assume that Sarah and Ram are reading a same record. First Ram updates that record with some new data. Later if Sarah also updates the record (mind you she is viewing the old content only still) then it would overwrite the changes made by Ram. There are two ways of solving this issue they are: 1. Pessimistic Locking 2. Optimistic Locking Pessimistic Locking: First person who reads the record would put a lock on it so that nobody else can change it until he is done with it. Only when he releases the record the other user can make use of it. This method is not recommended because it might also takes hours or days together for the first person to release his lock due to various reasons. Optimistic Locking: The record would be locked only when a user wants to modify its content. SQL Server has a TSEqual (I presum
I write about things which I am passionate about.