Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

How to tell when all records are committed and Record commit time instead just getdate()

$
0
0

We have several processes  inserting records for one Batch.

Recently we’ve had some long blocking so some of the inserts for a batch were blocked while the select statement to get a count of this batch ran ( we use read_committed_snapshot) and returned an incorrect count because it was missing the blocked inserts.

Additionally the time_updated is using getdate() and that stores the time the record is parsed not the time it is finally written to the database so it is not correct.

Is there any way to store the time the record is actually saved?

Is there any method to ensure all records for a batch are committed before we run the select of the count? This is a very busy process and we need correct counts.  We’ve thought of using some sort of separate queuing when inserting and then making sure the number of records in the queue match the database. Is there a better way?


KD


Viewing all articles
Browse latest Browse all 12963

Trending Articles