Compares timestamp values to prevent update on a row that has been modified since it was selected for browsing.
tsequal(browsed_row_timestamp, stored_row_timestamp)
alter table publishers add timestamp
If the values in the two timestamp columns are equal, tsequal updates the row. If the values are not equal, tsequal returns the error message below:
update publishers set city = "Springfield" where pub_id = "0736" and tsequal(timestamp, 0x0001000000002ea8)
Msg 532, Level 16, State 2: Server 'server_name', Line 1: The timestamp (changed to 0x0001000000002ea8) shows that the row has been updated by another user. Command has been aborted. (0 rows affected)
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute tsequal.