Home All Groups Group Topic Archive Search About

Newbie Table Design Question

Author
2 Sep 2005 10:03 AM
Alastair MacFarlane
Dear All,

I am looking over the design of another person's Database and I find that
nearly all tables have Primary Keys and also a column called:

rowguid - uniqueidentifier - with a (newid()) default value

Why would the designer need a primary key and a GUID in every table. I am
confused.

Thanks again.

Alastair MacFarlane

Author
2 Sep 2005 10:26 AM
David Portas
The GUIDs may be for the purposes of Replication. Or they may just be
surrogate keys. Some people like to use GUIDs as surrogate keys,
although for reasons of size and practicality I think that's a bad idea
as a general rule.

--
David Portas
SQL Server MVP
--
Author
2 Sep 2005 10:32 AM
R.D
Hi
The Basic Normalization rule of Atomicity is generally achieved through
PK.This is used for reference and joins. But Unique Identifier as name
suggests is said to be globally unique(takes 16 bytes). The limitation of
this using as a primary key is that it is too big hindering the
performance.It appears to me that he initially tried to use unique identifier
as PK later perhaps found that using Natural key increases the performance.
This is only my guess. Unqueidentifier is also useful when you want to use
union between two table when merged Horizantally and still force uniqness.
This may not be possible with table level PK. This can be handy if one wants
to enforce uniqueness in partioned views(I guess Last one)

Regards
R.D





Show quote
"Alastair MacFarlane" wrote:

> Dear All,
>
> I am looking over the design of another person's Database and I find that
> nearly all tables have Primary Keys and also a column called:
>
> rowguid - uniqueidentifier - with a (newid()) default value
>
> Why would the designer need a primary key and a GUID in every table. I am
> confused.
>
> Thanks again.
>
> Alastair MacFarlane

AddThis Social Bookmark Button