Is possible NEWSEQUENTIALID() repeat with NewId()?

269 views Asked by At

I used to have a table with about 1000W data, the primary key column's datatype is uniqueidentifier, and the default value is Newid(). Now there is a performance problem, and I want to change the default value to NEWSEQUENTIALID().

Is it possible for the GUID generated by NEWSEQUENTIALID() to duplicate the data previously saved (previously generated by NewId())?

1

There are 1 answers

0
Damien_The_Unbeliever On

NEWSEQUENTIALID effectively creates a Version 1 UUID.

NEWID creates a Version 4 UUID.

Although NEWSEQUENTIALID does apply some byte scrambling, it does leave the version nybble intact. This means that there's no chance of a collision between a NEWSEQUENTIALID created guid and a NEWID one.