Guid vs INT - Which is better as a primary key?
177
votes
6
answers
186117
views
I've being reading around reasons to use or not
Guid
and int
.
int
is smaller, faster, easy to remember, keeps a chronological sequence. And as for Guid
, the only advantage I found is that it is unique. In which case a Guid
would be better than and int
and why?
From what I've seen, int
has no flaws except by the number limit, which in many cases are irrelevant.
Why exactly was Guid
created? I actually think it has a purpose other than serving as primary key of a simple table. (Any example of a real application using Guid
for something?)
( Guid = UniqueIdentifier ) type on SQL Server
Asked by BrunoLM
(3533 rep)
Jan 5, 2011, 07:46 AM
Last activity: May 7, 2024, 01:21 PM
Last activity: May 7, 2024, 01:21 PM