RANDOM_FLOAT (TSQL Function)

Returns a random float between the two values passed as arguments, inclusively.

Syntax

RANDOM_FLOAT ( startval , endval )

Arguments

startval
is the start value, of type float. It must be a constant literal.
endval
is the end value, of type float. It must be a constant literal.

Return Types

Returns float.

Remarks

The returned value is uniformly distributed.

This function doesn’t exist in MS SQL Server.

You should use it to easily fill your test tables with random float values.

Examples

See RANDOM_VARCHAR and RANDOM_NUMERIC.