How about this?

<cfset Unique_ID = DateFormat(Now(),"yymmdd") & TimeFormat(Now(),"hhmm")
& "-" & Right(GetTickCount(),5)>

It's not *totally* bulletproof.  If two processes run the code at the
exact same millisecond, you'll have a duplicate ID.  I would implement
this line plus the
database INSERT within a <CFLOCK>.  That would pretty much kill any
chance
of a dup.  On a very high volume site, I would use the database
facilities that others have described.

Keith Meade
www.kmweb.com

----- Original Message -----
From: "HappyToad.com" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, September 28, 2000 7:12 AM
Subject: RE: Autonumber?


: I am getting the following error when I tried to use the code you sent
me.



------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to