NEWID
nondeterministic generator
What changes
- Input
- none
- Output or change
- new uniqueidentifier per call
- Return type
- uniqueidentifier
Syntax at a glance
NEWID ( )
Work example
Generate a uniqueidentifier for a sample key or application token value.
Generate identifiers in the intended insert scope and avoid exposing them as secrets.
Check your work NEWID is nondeterministic and a generated GUID does not provide access control.
Practice SQL
Open in SQL FlowSELECT NEWID() AS sample_id;
Open Microsoft Learn for full syntax, permissions, and details for your version.