You didn't mention what frontend language you use, but here's a tip from my experience with c#'s datasets and the "use optimistic concurrency" option
When you download a row into a DataTable, the dt tracks the original values it downloaded:
SELECT id, name, age, address FROM person
--> 1, Jon, 33, null
You make an update:
dt[0].Name = "Paul"
The row now tracks two values, original (Jon) and current (Paul)
Sending the update back to the database, it runs a query like this:
UPDATE person
SET name = @currentName
WHERE id = @originalID and
(Name = @originalName or (@originalName is null AND name is null)) AND
...
So effectively:
UPDATE person
SET name = 'Paul'
WHERE id = 1 and
(Name = 'John' or ('John' is null AND name is null)) AND...
This way data that has been changed/nulled/nonnulled by a foreign client can be detected
It may be simplest to use an ORM for your language, that has this facility
-
ps: Perhaps a simpler notion for this is to add an int column and a trigger to increment it. It probably doesn't sit well with most people though, to add a column that is purely for information control in this manner, rather than modelling some real world data aspect of the stored entity