On Transact SQL language the rowversion is a data type that generate automatically unique binary numbers within a database. The storage size is 8 bytes.
Rowversion syntax:
rowversion
Rowversion example:
USE model;
GO
CREATE TABLE myTest (
id int PRIMARY KEY,
name char(20),
test_column rowversion
);
GO
INSERT INTO myTest (id, name) VALUES (1, 'test_1');
GO
INSERT INTO myTest (id, name) VALUES (2, 'test_2');
GO
SELECT * FROM myTest;
GO
id | name | test_column |
---|---|---|
1 | test_1 | 0x0000000000000FA1 |
2 | test_2 | 0x0000000000000FA2 |