Be careful if you deploy this method -- make sure you wrap the initial query (maxID) and the insert of the new ID in a transaction tag, otherwise you could run into conflicts with identical IDs.
Best to have the database handle this. The date+random num is a good second choice; chances are there will be at worst 2-3 loops before hitting a unique value, BUT there is stil the transaction caveat: two people/thread could be running same test, coming up OK and then the second (slowest) user will hit an error because of a duplicate. CFTRANSACTION is one of ColdFusion's slickest features. Much easier than database-level transaction handling. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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

