[thelist] Free Tip about SQL

Tab Alleman Tab.Alleman at MetroGuide.com
Fri Jul 18 13:50:03 CDT 2003

Joshua Olson wrote:
> ----- Original Message -----
> From: "Rob Smith" <rob.smith at THERMON.com>
>> "Add another column in your table for a timestamp varchar(24)
>> variable. Store that number as a variable. Then at your leisure call
>> for a row that contains your newly added timestamp variable and
>> you'll have the new ID. 

> Also, a GUID may provide you an alternative to using a timestamp.

Actually, if you're using SQL Server, and you're really using a
timestamp data-type, then the value is guaranteed to be unique, even if
someone else does an insert less than a millisecond later.  BOL has this
to say about the Timestamp data type:

timestamp is a  data type that exposes automatically generated binary
numbers, which are guaranteed to be unique within a database. timestamp
is used typically as a mechanism for version-stamping table rows. The
storage size is 8 bytes.

More information about the thelist mailing list