In SQL Server we have one more data type called
UNIQUEIDENTIFIER. This is also used frequently to track the changes in table as
well as to program some security based features. The following are the
differences between TIMESTAMP and UNIQUEIDENTIFIER.
·
Size of TIMESTAMP value is 8 bytes whereas size of UNIQUEIDENTIFIER
is 16 bytes.
·
TIMESTAMP is not based on system date or time. However, UNIQUEIDENTIFIER
value is based on the computer's MAC addresses and system date time.
·
The purpose to TIMESTAMP is to track the operation in tables on
the database level. The purpose of UNIQUEIDENTIFIER
is to have a unique value assigned to a row (maybe as primary key). It remains unique in any system in the world.