Returns a random value between 0 and 1, which is generated using the specified seed value, and computed for each returned row when used in the select list.
rand ([integer])
integer is any integer (tinyint, smallint, or int) column name, variable, constant expression, or a combination of these.
If there are n rows in table t, the following select statement returns n different random values.
select rand2 from t ------------
Unlike rand, rand2 is computed for each returned row when it is used in the select list.
rand2 is currently defined to work only with the the select list.
For more information about the 32-bit pseudorandom integer generator, see the Usage section of rand, in the Reference Manual: Blocks.
For general information about mathematical functions, see Volume 1, Blocks, of the Reference Manual.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute rand2.