SQL Flow Field Guide

RAND

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

pseudo-random value

What changes

Input
optional seed
Output or change
float in [0,1)
Return type
float

Syntax at a glance

RAND ( [ seed ] )

Work example

Generate a pseudo-random float for a controlled sample or demonstration.

Test domain limits and the largest expected input. Keep degree and radian units explicit.

Check your work Do not use RAND for cryptographic secrets or assume per-row independent values.

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