0

Possible Duplicate:
Is a GUID unique 100% of the time?

I'm using GUID as my primary key columns for tables in a SQL CE 3.5 database that I'm performing CRUD operations on using Entity Framework.

When I create my id's I set them as

configuration.Id = Guid.NewGuid();

How unique is Guid? It's a pretty big string, is there any possibility that Guid.NewGuid() could return a value that it already used?

Community
  • 1
  • 1
mservidio
  • 12,404
  • 8
  • 54
  • 82
  • 2
    The answer is no, but effectively yes. See: http://stackoverflow.com/questions/39771/is-a-guid-unique-100-of-the-time – Reddog Sep 03 '11 at 01:17

1 Answers1

2

It is technically possible, but so unlikely that you don't have to worry about it.

Note that Guid.NewGuid is not kind to database index clustering. I did design a combed GUID for use on mobile devices back in the day if that helps.

Stephen Cleary
  • 406,130
  • 70
  • 637
  • 767