GUID (Global unique identifier) is a globally unique identifier, which consists of the ID numbers on the NIC (each Nic has a unique ID number) and a 16-byte binary value generated by the unique number of the CPU clock.
The GUID format is "xxxxxxxx-xxxx-xxxxxxxxxxxx", where each x is a hexadecimal number in the range of 0-9 or a-f. Example: 76895313-839E-4E89-BAFC-B253BFF3173F
No two computers in the world will generate duplicate GUID values. GUID is used to assign a unique identifier to a network or system with multiple nodes and computers. On Windows, GUID is widely used: Registry, class and interface identifiers, databases, and even automatically generated machine names and directory names.
1. SQL Server database
Previously, the SQL Server database specified the column type as uniqueidentifier In the table definition, and the column value is of the GUID type.
2. Produce a GUID using a T-SQL
Insert into table1 (id, name,...) values (NewID (), 'zhang san ',...)
3. Create a GUID in C #
Guid guid = Guid. NewGuid ();
Console. Writeln (guid. ToString ());
4. Create a UUID in Java
Only by checking information on the internet can we know that in Java, UUID is changed. The creation method is also surprisingly simple
System. out. println (java. util. UUID. randomUUID ());