I have two tables with alternate keys...one is the user table that has a auto incrementing PK with the email (user name in this application) as a unique alternate key and one table of uploaded file info with an auto incrementing PK with file name (combination of file name and job name) as a unique alternate key. When records are added to either of these tables, records are added to other tables that have to relate to these new records and we can't be sure, with multiple users, of what the auto incrementing PK is (because that is set by the DB), but we do know the alternate key, bacause we actually insert that with the new record. So we can use that alternate key to be sure, 100% sure, we are grabbing the right record's PK.
HTH Mark Fuqua -----Original Message----- From: Rick Faircloth [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2008 7:38 PM To: CF-Talk Subject: RE: Any "Gotcha's" in using CF UUID for db record primary key? Thanks for the feedback, Dominic. I'll have to do some more research on this approach. I was thinking that the UUID would take the place of using the PK my databases, as in: a href="community.cfm?community_uuid="#url.community_uuid" and I would begin to code all my links using the uuid as the "relational" key instead of the PK. I need to become more familiar with using unique constraints, etc. Rick > -----Original Message----- > From: Dominic Watson [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 23, 2008 7:10 PM > To: CF-Talk > Subject: Re: Any "Gotcha's" in using CF UUID for db record primary key? > > Hi Rick, > > Personally, I would still use an auto-incrementing integer for the PK but > have the UUID as a separate field with a unique constraint. Primary keys are > not for making a single row unique but for facilitating the relational bit > of relational databases (i.e. defining Foreign Key relationships). Having > PKs as narrow as possible is better for performance when querying a database > across relationships (i.e. using Joins, etc). > > Of course, as well as having the unique constraint on the GUID, your table > should also define a constraint/index that logically defines what makes a > row unique (i.e. a combination of account number and sort-code is a logical > unique identifier for a bank account and should have a unique index or > constraint - but not be a PK). > > HTH > > Dominic > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301872 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

