Mike C (6/9/2009)
drogers (6/9/2009)
A minor quibble with the article: the problem is not that RAND() is called multiple times with the same seed, once per row. The problem is that RAND() is only called once per query (just like GETDATE()).
Another minor quibble - each instance of RAND() is invoked once per query.
SELECT RAND(), RAND()
Generates two different random numbers because RAND() is actually called twice. Each RAND() result is repeated for every row of the result set (in this case only one row).
Heh... correct identification of the problem in 90% of the solution. We know the behavior and the work around. Use the work around.
--Jeff Moden
Change is inevitable... Change for the better is not.