jgroat
jgroat

Reputation: 33

How are uniqueidentifiers calculated?

I was curious as to how SQL Server calculates uniqueidentifiers. I understand that uniqueidentifiers, are GUIDs but are these calculated based on system time? Or are they calculated based on the name of job/script that has called the NEWID() function. I found this but i found this reference to be unclear.

Upvotes: 2

Views: 630

Answers (2)

Martin Smith
Martin Smith

Reputation: 453278

It depends on whether you are generating them from NEWID() or NEWSEQUENTIALID() (the last one uses an algorithm involving the mac address the first one doesn't)

Upvotes: 1

Otávio Décio
Otávio Décio

Reputation: 74270

I find the Wikipedia entry quite informative.

Upvotes: 2

Related Questions