HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

UUID type for NEWID()

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
uuidtypefornewid

Problem

Does the NEWID() function generate UUID version 4?

Link to Wikipedia with versions

What is the situation with the NEWSEQUENTIALID() function?

Does the data always provide us with the UUID standard and version? Maybe it should be generated on the application side?

Solution

Following to the Wikipedia page that you mentioned above (in the Database key section):

The NEWID function in Microsoft SQL Server version 4 Transact-SQL returns standard random version-4 UUIDs, while the NEWSEQUENTIALID function returns 128-bit identifiers similar to UUIDs which are committed to ascend in sequence until the next system reboot.

Context

StackExchange Database Administrators Q#238103, answer score: 13

Revisions (0)

No revisions yet.