timestamp (T-SQL)

A database-wide unique number. The storage size is 8 bytes.

Remarks

A table can have only one timestamp column. The value in the timestamp column is updated every time a row containing a timestamp column is inserted or updated. This property makes a timestamp column a poor candidate for keys, especially primary keys. Any update made to the row changes the timestamp value, thereby changing the key value. If the column is in a primary key, the old key value is no longer valid, and foreign keys referencing the old value are no longer valid. If the table is referenced in a dynamic cursor, all updates change the position of the rows in the cursor. If the column is in an index key, all updates to the data row also generate updates of the index.

The value of a timestamp column is unique within a database.

A nonnullable timestamp column is semantically equivalent to a binary(8) column. A nullable timestamp column is semantically equivalent to a varbinary(8) column.

See Also
ALTER TABLE DECLARE @local_variable
CAST and CONVERT DELETE
CREATE TABLE INSERT
Data Type Conversion SET @local_variable
Data Types UPDATE

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.