The Adventures of a SQL Server DBA
Tips on T-SQL, SQL Server DBA stuff, and more!
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment