In SQL 2000 Server, using the Enterprise Manager, you create a new field (probably an integer), set it to be an identity, tell it where you want to start counting (we find 1 to be convenient) and what you want to increment by (again, 1 is convenient :-)
Each time a record is inserted, it will get a brand spanking new number that is guaranteed to be unique. -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -----Original Message----- : From: FlashGuy [mailto:[EMAIL PROTECTED] : Sent: Monday, March 10, 2003 2:28 PM : To: CF-Talk : Subject: RE: Inserting date/time stamp : : : On Mon, 10 Mar 2003 14:23:36 -0500, Ben Doom wrote: : : > You could always use an application variable. I'm not sure : what that has to : > do with a date/time object. : > : > Just out of curiosity, if this is going to a database, can't : you just create : > a unique self-incrementing field and use that? : : How? : : > : > -- Ben Doom : > Programmer & General Lackey : > Moonbow Software, Inc : > : > : -----Original Message----- : > : From: FlashGuy [mailto:[EMAIL PROTECTED] : > : Sent: Monday, March 10, 2003 2:14 PM : > : To: CF-Talk : > : Subject: Inserting date/time stamp : > : : > : : > : Hi, : > : : > : I have a form that I want to insert the date and time when the : > : form is opened. This will also be saved to a database when saved. : > : : > : Whats the best way of also creating a "automatic" reference no : > : which increments when a "new" form is opened? : > : : > : Any ideas... : > : : > : : > : --------------------------------------------------- : > : Colonel Nathan R. Jessop : > : Commanding Officer : > : Marine Ground Forces : > : Guatanamo Bay, Cuba : > : --------------------------------------------------- : > : : > : : > : : > : : > : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4