Considering that GUIDs are _supposed_ to be globally unique, I would
just attempt the insert and then try/catch any insert errors.

GUIDs are made of time/machine information, etc, so it would be nigh
impossible to ever run across a duplicate.

Considering a 35-byte, hex-char GUID, this is how many values a GUID
could be:
1.3937965749081639463459823920405e+42  (16^35)
Or
1,393,796,574,908,163,946,345,982,392,040,500,000,000,000

(I'm no math major, but I'm sure it larger than what Dr. Evil wanted to
spare the world from "Preparation H" or the "Alan Parsons Project".)

4.419699945802143411802328741884e+33 is the approximate number of years
of GUID use if you figured one GUID spent per second.

(Either my math is correct or it is grossly out of whack.  I don't
know.)

M!ke

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Marlon Moyer
Sent: Wednesday, December 08, 2004 10:36 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] GUIDs as Primary/Foreign Keys

On the subject of creating a guid before the insert, wouldn't you still
have to query the db to make sure the guid isn't already in there.  I
know the chances are very, very slim, but it's not impossible, right?


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
> Behalf Of Dave Watts
> Sent: Wednesday, December 08, 2004 9:42 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] GUIDs as Primary/Foreign Keys
> 
> > from what you know/read have you seen any performance notes on using

> > GUID's vs. Identity int's?
> 
> I haven't run into any performance problems yet. Presumably, with a 
> large enough dataset you might, but SQL Serve handles indexed strings 
> nicely enough in most cases.
> 
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> phone: 202-797-5496
> fax: 202-797-5444
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to 
> [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, 
> Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at www.mail- 
> [EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool,
Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
[EMAIL PROTECTED]

Reply via email to