NEWID

Description

Creates a unique value of type uniqueidentifier. (NEWID in Transact-SQL).

Sample Source Pattern

Syntax

NEWID ( )  

Examples

Outputs may differ because it generates a unique ID in runtime

Code:

IN -> SqlServer_01.sql
SELECT NEWID ( ) AS ID;

Result:

+------------------------------------+
|ID                                  |
+------------------------------------+
|47549DDF-837D-41D2-A59C-A6BC63DF7910|
+------------------------------------+

Last updated