I\'m using Guids as primary keys in my database and was wondering if it is ever possible that a duplicate Guid might be generated. Are Guids guaranteed to be unique?
While each generated GUID is not guaranteed to be unique, the total number of unique keys (2128 or 3.4×1038) is so large that the probability of the same number being generated twice is very small.
You can check more info on that here.
A possible solution to avoid duplicate guids (if you still want one) is to use the UNIQUE constraint.