NEWID function [Miscellaneous]

Function

Generates a UUID (Universally Unique Identifier) value. A UUID is the same as a GUID (Globally Unique Identifier).

Syntax

NEWID ( )

Parameters

There are no parameters associated with NEWID().

Usage

The NEWID() function generates a unique identifier value.

UUIDs can be used to uniquely identify rows in a table. The values are generated such that a value produced on one computer will not match that produced on another. Hence they can also be used as keys in replication and synchronization environments.

You cannot use the NEWID function as a column default for an IQ table.

NEWID is a non-deterministic function. Successive calls to NEWID may return different values. The query optimizer does not cache the results of the NEWID function.

For more information about non-deterministic functions, see CREATE FUNCTION statement.

Standards and compatibility

See also

“STRTOUUID function [String]”

“UUIDTOSTR function [String]”

UNIQUEIDENTIFIERSTR in Character data types