Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vivek.kumargupta
Starting Member
45 Posts |
Posted - 2005-06-08 : 03:30:42
|
Hi All,I need some info regarding the TimeStamp column.I am using the timestamp column to mark a row as unique. SQL Books Online says that the binary generated is unique throughout the whole database.But my question is, does timestamp generate the "unique" binary numbers in an incremental fashion, OR does it recycle its unique numbers.I'm stuck with a strange problem that the max(cast(timestamp as bigint)) doesnt return me the latest record!!Any help will be highly app. Its urgent !!!!!TIAVivek. |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-06-08 : 04:12:19
|
You should not try to use it for that. It is only a unique ROWVERSION. You will notice that BOL makes no mention of this number being sequential. Aslo, a timestamp changes every time the row is updated.If you need a unique identifier for a row, you should use either an IDENTITY column, or a column with a uniqueidentifier datatype. It sounds like an IDENTITY column will be best for you, because each new row will have a higher IDENTITY value than the last one.quote: Originally posted by vivek.kumargupta Hi All,I need some info regarding the TimeStamp column.I am using the timestamp column to mark a row as unique. SQL Books Online says that the binary generated is unique throughout the whole database.But my question is, does timestamp generate the "unique" binary numbers in an incremental fashion, OR does it recycle its unique numbers.I'm stuck with a strange problem that the max(cast(timestamp as bigint)) doesnt return me the latest record!!Any help will be highly app. Its urgent !!!!!TIAVivek.
CODO ERGO SUM |
|
|
|
|
|