SQL Flow Field Guide

NEWID

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

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 Flow
SELECT NEWID() AS sample_id;

Open Microsoft Learn for full syntax, permissions, and details for your version.