SQL Server RAND() Function
Example
Return a random decimal number (no seed value - so it returns a completely random number >= 0 and <1):
SELECT RAND();
Try it Yourself »
Definition and Usage
The RAND() function returns a random number between 0 (inclusive) and 1 (exclusive).
Syntax
  RAND(seed)
Parameter Values
| Parameter | Description | 
|---|---|
| seed | Optional. If seed is specified, it returns a repeatable sequence of random numbers. If no seed is specified, it returns a completely random number | 
Technical Details
| Works in: | SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse | 
|---|
More Examples
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.