rand() in TSQL isn't random at all!
Trying to return a query with a random sort order from TSQL I thought the most obvious
way would be like this:
SELECT *
FROM Northwind..Customers
order by rand()
However for a multi line select statement the value of rand() will be the same for each
row.
This article here has a neat work around with a custom view and a custom function.
However a colleague rightly pointed out that this will do the trick.
SELECT *
ROM Northwind..Customers
order by newid()
Thanks Val!
