I would like to generate a random value from the uniform distribution with mean=0 and a standard devation=1 for every row of a given data table in T-SQL. Additionally, I would like to set a seed in order to ensure reproducibility of analysis. Here are the ideas which did not work:
-
Using the function
RAND()
with a declared number does not fulfill this objective: the same random value is generated for every row of the data set. -
Such a solution:
SELECT ABS(CAST(CAST(NEWID() AS VARBINARY) AS INT)) AS [RandomNumber]
does not solve the problem either since it is not reproducible.
Aucun commentaire:
Enregistrer un commentaire