RANDOM_BIGINT (TSQL Function)

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

Syntax

RANDOM_BIGINT ( startval , endval )

Arguments

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

Return Types

Returns bigint.

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 bigint values.

Examples

See RANDOM_VARCHAR and RANDOM_NUMERIC.

RSQL, a simple alternative to Microsoft SQL Server