Saturday, January 21, 2006

Google Groups : microsoft.public.sqlserver.programming: "Hi J.R.

You've given great, in-depth answer that covers a number of the important
differences between GUID / Integer.

One thing I want to address in your post though is: 'I feared the counter
could exceed 2 billion.'. Perhaps you've worked this out since, but just so
all is clear to whoever reads your post, identity is not limited to 2
billion in SQL 2K as columns with the integer type BIGINT (8 byte) can also
be used for identity which allow for values from -9,223,372,036,854,775,808
through 9,223,372,036,854,775,807.

Another classic scenario where GUIDs can be advantageous over IDENTITY is
where there the application design needs to know the key between master /
detail records at the application layer, BEFORE insertion into the database.
This can eliminate a network round trip between the application layer and
the DB just to generate a key in such a scenario. This is often presented in
argument about the advantages / disadvantages of IDENTITY / GUID as an
advantage for GUID, especially where the benefit of the application layer
knowing the ID before insertion into the DB out-weighs the draw-back of the
extra storage size footprint of a GUID. "

0 Comments:

Post a Comment

<< Home