I have a column in my table, say updateStamp. I would like to get an approach to updating this field with a new serial number after updating the row.
There is a lot of traffic in the database, mostly reading, but several simultaneous updates can also be performed in batches. Therefore, the solution should cause minimal blockages.
The reason for this requirement is that I need to have a solution for clients to iterate over the table forward and update the row - it should appear again in the result set.
So, the request will look like
SELECT *
FROM mytable
WHERE updateStamp > @lastReturnedUpdateStamp
ORDER BY updateStamp
Unfortunately, timestamps do not work, because several updates can occur at the same time.