dbTalk Databases Forums  

The TIMESTAMP data type

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss The TIMESTAMP data type in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Greenberg
 
Posts: n/a

Default The TIMESTAMP data type - 08-06-2003 , 01:45 AM






Hi
I'm interested in using the timestamp data type & I have some questions.

As far as I can understand the contant of a timestamp column is a binary
value.
Is there any connection between that value and a valid date (as the word
timestamp means) or is it a left over from the days when the timestamp
value really was a datetime type (so it says in Books Online) ?
or is it just a unique identification of a row (a tuple id) ?
I tried converting a timestamp value to datetime and I got a date in 1900.

Thanks for any answer
David Greenberg


Reply With Quote
  #2  
Old   
Simon Hayes
 
Posts: n/a

Default Re: The TIMESTAMP data type - 08-06-2003 , 04:29 AM






David Greenberg <davidgr (AT) iba (DOT) org.il> wrote

Quote:
Hi
I'm interested in using the timestamp data type & I have some questions.

As far as I can understand the contant of a timestamp column is a binary
value.
Is there any connection between that value and a valid date (as the word
timestamp means) or is it a left over from the days when the timestamp
value really was a datetime type (so it says in Books Online) ?
or is it just a unique identification of a row (a tuple id) ?
I tried converting a timestamp value to datetime and I got a date in 1900.

Thanks for any answer
David Greenberg
TIMESTAMP is a rather confusing name - in SQL2000 the synonym
ROWVERSION is preferred, which is a lot clearer. It's a unique value
which is changed every time the row is updated, so it can be used to
check if another user modified a row since you last queried it. If the
timestamp column has a different value than the one you saw, then the
row has been updated.

There's no connection with datetime data, but in the ANSI SQL
standard, TIMESTAMP is the equivalent of SQL Server's DATETIME, which
leads to some confusion.

Simon


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.