UUIDTOSTR function [String]

Function

Converts a unique identifier value (UUID, also known as GUID) to a string value.

Syntax

NEWIDuuid-expression )

Parameters

uuid-expression A unique identifier value.

Example

To convert a unique identifier value into a readable format, execute a query similar to:

SELECT UUIDTOSTR(uid_col),c1 FROM mytab

Usage

Converts a unique identifier to a string value in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where x is a hexadecimal digit. If the binary value is not a valid unique identifier, NULL is returned.

Standards and compatibility

See also

“NEWID function [Miscellaneous]”

“STRTOUUID function [String]”

UNIQUEIDENTIFIER in “Binary data types”