There is a single counter for the database. All tables' values will be drawn from this single source. This is mentioned in the documentation:
Each database has a counter that is incremented for each insert or update operation that is performed on a table that contains a rowversion column within the database.
This can be shown with a simple example. I'll create a new database and two tables
create database DBX;
use dbx;
create table t1(cola int, colb rowversion);
create table t2(cola int, colb rowversion);
Adding a row will produce a rowversion value
insert t1(cola) values (1);
select * from t1
On my system this returns
cola colb
----------- ------------------
1 0x00000000000007D1
Your system may produce a different number. The value is hexadecimal, and meaningless.
Adding a row to t2
insert t2(cola) values (2);
produces this:
cola colb
----------- ------------------
1 0x00000000000007D1
cola colb
----------- ------------------
2 0x00000000000007D2
Repeating produces the expected result, rowversion increments
insert t1(cola) values (3);
cola colb
----------- ------------------
1 0x00000000000007D1
3 0x00000000000007D3
cola colb
----------- ------------------
2 0x00000000000007D2
Note the new rowversion is one more than that in t1.
If I restart the instance and add a row something interesting happens
<restart>
insert t2(cola) values (4);
cola colb
----------- ------------------
1 0x00000000000007D1
3 0x00000000000007D3
cola colb
----------- ------------------
2 0x00000000000007D2
4 0x0000000000002711
The rowversion has jumped significantly. So it is monotonic, but not continuous over an instance restart. Similar behaviour has been observered with SEQUENCES and IDENTITY columns.
So, rowversion can be used to label a "high water" mark in an ETL process. It cannot be used exclusively for a particular table, however. An IDENTITY would be a better choice for that purpose. I have no idea what SQL Server would do if rowversion were ever to overflow.
ROWVERSION
, you'd need to save the max value every time the table is queried. – Dan Guzman Jun 28 '18 at 11:03ROWVERSION
when we query the database though, as our software has a mechanism for that sort of thing. – Donglecow Jun 28 '18 at 11:08