Results In Random Order

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Although SQL Server does not have a built in way to return your query results in random order, you can accomplish this in an easy way.  One thing to note is that this way of returning the results is very expensive… so it could take a while.

In the following example, the magic happens in the order by clause.  The NEWID() function will generate a unique GUID for every record.  This will cause the results to come back randomized.

Syntax