Friday, March 25, 2011

Randomly Ordering a ResultSet in SQL Server

-- I found this T-SQL function to be quite handy. It returns the records in a random order every time.

SELECT *
FROM myTable
ORDER BY NEWID()

No comments:

Post a Comment