Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle's SYS_GUID() vs MS SQL Server NEWID()
"Daniel Morgan" <damorgan_at_exxesolutions.com> wrote in message
news:3F467D5A.7E4CCAC4_at_exxesolutions.com...
> Maximus wrote:
>
> > "Uma Muthu" <Mail_at_NoCoolSpamBlue.com> wrote in message
> > news:Z5u1b.6048$Nc.3791467_at_news1.news.adelphia.net...
> > > I am working with two databases who share data: an Oracle 9i DB and a
MS
> > SQL
> > > Server 2000. I am concerned that GUIDs that are generated on one DB
may
> > be
> > > duplicated ):- on the other DB, and when we go to share data a
duplicate
> > key
> > > scenario might arise.
> > >
> > > Is there any way I can determine the algorithms used to generate the
GUIDs
> > > on both DBs so that I can format them (if I have to) in a way that
they
> > > will
> > > never collide? I use sys_guid() to generate GUIDs in Oracle, and
NewID()
> > in
> > > SQL Server.
> > >
> > > Any suggestions would be appreciated.
> >
> > GUID's are 128 bit values, you shouldn't worry about collisions as the
> > chance of this happening is so fantastically small.
>
> I agree but at the same time it is theoretically possible. Can you put
them into
> ranges such that values are not accepted and another attempt made unless
they
> are obviously separate?
>
> --
> Daniel Morgan
> http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
> damorgan_at_x.washington.edu
> (replace 'x' with a 'u' to reply)
Theoretically possible but very improbable (2^128 = 3.4028E+38) though it's really dependent on the algorithm used for generation. The only way to guarantee uniqueness is to tack on a database identifier to the GUID. Received on Fri Aug 22 2003 - 16:07:07 CDT