Converts a string value to a unique identifier (UUID or GUID) value.
STRTOUUID ( string-expression )
string-expression A string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Converts a string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where x is a hexadecimal digit, to a unique identifier value. If the string is not a valid UUID string, NULL is returned.
This function is useful for inserting UUID values into an IQ database.
“NEWID function [Miscellaneous]”
CREATE TABLE T ( pk uniqueidentifier primary key, c1 int); INSERT INTO T (pk, c1) VALUES (STRTOUUID ('12345678-1234-5678-9012-123456789012'), 1);