mverma4you (3/2/2009)
you are not allowed to use the RAND() function inside UDF function. To call the value of this function create a view with the single statement select RAND()And then call that view inside your function.
And you still end up with a RBAR solution that way... Don't use RAND to generate random numbers... it just doesn't work the right way in T-SQL.
--Jeff Moden
Change is inevitable... Change for the better is not.