<<The very definition of GUID is that they are guaranteed to be unique.>>
Actually, that's not correct. There is no absolute guarantee that you won't get a duplicate. But with the range on 128 bits (2^128), the chance is so small that you'll get one that for all intents and purposes you can assume that it is. Jim. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Paul McNett Sent: Tuesday, June 23, 2009 7:33 PM To: [email protected] Subject: Re: Generating GUIDs for primary keys in your app (VFP9SP2) MB Software Solutions, LLC wrote: > I like to design in n-tier fashion, so that I can use either a VFP or > non-VFP (like MySQL) backend on the flip of a switch. > > I'm creating a new framework that will use GUID primary keys instead of > integers. > > My question is this: is it best to generate those GUIDs from the app or > use some stored proc in the database? I'm thinking the former should > suffice, but of course I have slight concern of some freak occurrence of > the same string key. Very remote chance probably, but I like to be sure > and use the best practice if possible. The very definition of GUID is that they are guaranteed to be unique. I generate them in the app, so my app is as database-agnostic as possible. Paul [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/43bfcb8b37b04b4f813075073288b...@xps ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

