The basic problem is like this:
A subscriber has successfully replicated a row from the publisher, using transactional replication. Now, how do we keep track the time of this row being last successfully replicated?
A friend has suggested the following solution, which he used for his SQL Server 2000:
1) Add a datetime column.
2) Change the replication stored procedure to update the datetime column (!).
The step #2 sets off all sorts of warning bells within me, so I’m asking if there are better solutions for SQL Server 2005 in this situation, before I even go into detail with his solution.
I’d do exactly what your friend suggested. That way, only calls to the replication procedure would update the timestamp.
The problem with this approach is that you need a write lock, but I don’ see any other practical way.
You could otherwise use a trigger that fires when you fetch the row (don’t quote me on that, I very seldom used triggers), but that doesn’t seem right (you might end with false positives)