Exclusive access to edit rows I'm developing a program that allows users to view and edit data.
My question:
Is there tools (sql server tools, may be users/roles) to implement the following:
There are two users: A and B. User A opened the edit form for row, at this point the user B can not edit the same row.

I know, that i can use colunm for store UserId(user, which edit this row), but this solution is not suitable.
One approach would be to use optimistic locking.

Before displaying the update form, you retrieve all the original values from the database. Or, at a minimum, a column that is guaranteed to change on update, such as last_update_date or similar.

When updating you check that all values are still the same in your where clause. If the update fails to update any rows you know that the values have been changed in between and inform the user that this has happened.