stan.teitelbaum (2/15/2010)
is this a better choice guys? RAND(checksum(newid())) ?perhaps because it increases randomness by not allowing dupes between negatives and positives? Perhaps also because none of us really knows if the combo of newid and checksim is as random as rand?
But it doesn't increase randomness... first, CHECKSUM doesn't do anything to prevent negative numbers (which is actually "more random" than just a positive set of numbers). Second, RAND in SQL server isn't random between rows in a set based result set... RAND requires a random seed for each row or you're relegated to a single row.
As a side bar, it's documented in BOL that NEWID() will return a random GUID that also happens to be unique from a given server.
--Jeff Moden
Change is inevitable... Change for the better is not.