Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uniqueidentifier can have duplicates?

Status
Not open for further replies.
Mar 29, 2004
120
US
Hi all,

can GUID column have dups even if I specify newid() function on it?

Thanks
 
Not if you were using that function from the begining. Thee odds would be that it will always create a unique. The only time I have seen this occur is when a record was imported from another DB from another server and we hit this issue. That event too was beyond belief but it did occure.

Thanks

J. Kusch
 
JayKusch, the reason i'm asking is 'cause I'm studying for 70-229 exam, and one of the questions implies (without explanation, as usual) that unless you specifically implement unique constraint, both identity field and GUID may allow duplicate values.

I've never had this issue in a real word, but just was wondering if it's really true.

Thanks
 
SQL BOL states that no 2 systems will create the same GUID while I have seen elsewhere that the chances of GUIDS replicating is Hundreds of billions or greater. The way you have worded the above question is true a GUID or identity column May allow duplicates without the Unique constraint. However an identity more than liekly will not create the same identity value, this is not to say that you can not insert a duplicate identity use SET IDENTITY INSERT ON. Another possible way to get a duplicate identity is to have the seed value get out of whack through manual inserts and deletions.



"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top