DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Select Random Row, SQL Server

02.26.2007
| 9026 views |
  • submit to reddit
        // select a random row in SQL Server, apparently. Untested.

SELECT TOP 1 column FROM table
ORDER BY NEWID()