As far as I can tell, it's by transactionid, not by time
Concurrency Update Issue in Temporal Tables
For a system-versioned table, when concurrent operations like INSERT
, UPDATE
, or DELETE
are performed, the system-generated timestamps (SYSTEM_TIME
columns) may reflect the same value. This makes it challenging to determine the exact sequence of the operations.
For example, when the following queries are executed in a single execution without any delay:
UPDATE TableA SET Column1 = Value WHERE ID = 1;
UPDATE TableA SET Column10 = Value WHERE ID = 1;
DELETE FROM TableA WHERE ID = 1;
In this scenario, all system-versioned timestamps are identical. Is there a way to determine the order of operations—first, second, and so on—without making changes to the schema?
2 answers
Sort by: Most helpful
-
-
LiHongMSFT-4306 30,751 Reputation points
2025-01-16T08:34:13.8366667+00:00 If the table contains a
rowversion
column, it incremented for each insert or update operation that is performed on that table.It tracks a relative time within a database, not an actual time that can be associated with a clock.
See this doc: rowversion (Transact-SQL)
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".