SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Timestamp datatype in MS-SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vivek.kumargupta
Starting Member

India
45 Posts

Posted - 06/08/2005 :  03:30:42  Show Profile  Reply with Quote

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 !!!!!

TIA

Vivek.

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 06/08/2005 :  04:12:19  Show Profile  Reply with Quote
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 !!!!!

TIA

Vivek.



CODO ERGO SUM
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000