$TSQL_NEWID returns a globally unique ID (GUID). A GUID is used to synchronize databases on occasionally connected systems. A GUID is a 36-character string consisting of 32 hexadecimal digits separated into five groups by hyphens. Its data type is %Library.UniqueIdentifier.
The $TSQL_NEWID function takes no arguments. Note that the argument parentheses are required.
The %Library.GUIDOpens in a new window abstract class provides support for globally unique IDs, including the AssignGUID()Opens in a new window method, which can be used to assign a globally unique ID to a class. To generate a GUID value, use the %SYSTEM.Util.CreateGUID()Opens in a new window method.
The following example returns a GUID:
TSQL: NEWID function