TIMESTAMP contains binary format string to denote a version of a row in table. so it is also called ROWVERSION.
A timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred.
Create Table:
CREATE TABLE TestTable(RowID INT IDENTITY(1,1) NOT NULL,
TIMESTAMP, [SmallDateTime] SMALLDATETIME,
[DateTime] DATETIME)
Table can have only one TIMESTAMP column. We can have either of a TIMESTAMP or ROWVERSION column type in table, but not both
Benefit of TIMESTAMP in multi-user access on TABLE.
Row-versioning can be used to examine the changes in table. It can also help to manage the synchronization in multiuse access.
If two user work on same table at the same time.
both A and B checks if the already read TIMESTAMP value still matches the TIMESTAMP value of the same row in the table, then they can go for update. If the TIMESTAMP value differs then it means another user has already modified that row, so it requires reading that table.
we do not need to update a timestamp column value manually
April 15, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment