If an ETL process attempts to detect data changes on system-versioned tables in SQL Server by including rows as defined by a rowversion
column to be within a rowversion
"delta window", e.g.:
where row_version >= @previous_etl_cycle_rowversion
and row_version < @current_etl_cycle_rowversion
.. and the values for @previous_etl_cycle_rowversion
and @current_etl_cycle_rowversion
are selected from a logging table whose newest rowversion
gets appended to said logging table at the start of each ETL cycle via:
insert into etl_cycle_logged_rowversion_marker (cycle_start_row_version)
select @@DBTS
... is it possible that a
rowversion
of a record falling within a given "delta window" (bounded by the 2@@DBTS
values) could be missed/skipped due torowversion
's behavior vis-à-vis transactional consistency? - i.e., is it possible thatrowversion
would be reflected on a basis of "eventual" consistency?
I'm thinking of a case where say, 1000 records are updated within a single transaction and somehow @@DBTS
is "ahead" of the record's committed rowversion
yet that specific version of the record is not yet readable...
(For the sake of scoping the question, please exclude any cases of deleted records or immediately consecutive updates on a given record within such a large batch transaction.)