The UNIQUEIDENTIFIER data type is typically used for a primary key or other unique column to hold UUID (Universally Unique
Identifier) values that uniquely identify rows. The NEWID function generates UUID values in such a way that a value produced
on one computer does not match a UUID produced on another computer. UNIQUEIDENTIFIER values generated using NEWID can therefore
be used as keys in a synchronization environment.
UUID values are also referred to as GUID (Globally Unique Identifier) values. UUID values contain hyphens so they are compatible
with other RDBMSs. You can change this by setting the uuid_has_hyphens option to Off.
UNIQUEIDENTIFIER values are automatically converted between string and binary values as needed.
UNIQUEIDENTIFIER values are stored as BINARY(16) but are described to client applications as BINARY(36). This description
ensures that if the client fetches the value as a string, it has allocated enough space for the result. For ODBC client applications,
uniqueidentifier values appear as a SQL_GUID type.