GUID stands for “Global Unique Identifier” and is a term usually referring to Microsoft’s implementation of unique identity number (in a distributed environment) that it generates to identify different entities such documents, COM’s, DLL’s, interfaces, records, and other objects. It is also known as UUID – Universal Unique Identifier interchangeably.

GUID implemenation is a 128 bit (16 byte) value consisting of sets of hexadecimal digits separated by hyphens. As the total number of unique keys is large the probability of two numbers being the same is very small.

The AutoNumber datatype in MS-Access and the Identity datatype in SQL Server is a GUID implementation.

Sample GUID in HEX notation
{aeb07ea0-7e70-11d0-a5d6-28db04c103004}
It is a combination of characters and numbers in the sequence of 8-4-4-4-12 hex digits

The above notation is a version 1 GUID. How do we find that? It is the first character in the third group of hex digits highlighted.

What do these version numbers carry?
1 – Time-based with unique or random host identifier
2 – DCE Security version POSIX UIDs
3 – Name-based using MD5 hash
4 – Random generation
5 – Name-based using SHA-1 hash

UUID in MySQL

mysql> select uuid();
+————————————–+
| uuid() |
+————————————–+
| 3fad8d9b-d55a-11de-82ee-a0651a5457b9 |
+————————————–+
1 row in set (0.00 sec)

The above example is given to help programmers use a similar pattern when migrating data from sql server to mysql.

Look in the RFC 8122 for UUID URI namespace.

In programming, the regular expression to check for a valid GUID pattern is given below
[0-9A-Z]{8}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{12}

News
Interesting read on GUID and Privacy