Home » Blog article: Selecting Random Rows in SQL Server 2005

Selecting Random Rows in SQL Server 2005

Here is a quick an easy way to select random rows in SQL Server 2005:

SELECT
     ColumnA, ColumnB
FROM
     dbo.[TableName]
ORDER BY
     NEWID()
  • jbcarey Says:

    Thanks for this, I was just wondering “how” exactly it works….

    just for clarification, if I were to build a “random image” in ASP.NET this would be what I need to use??

Leave a Reply




Brian Kupetz

Thats me above wearing one of my favorite Adidas track jackets. This is my home on the web showcasing some of my work over the past few years in the Interactive Marketing/Advertising field. In addition to my portfolio you'll find some personal information about me as well as some ramblings on some of the research and development I participate in. Enjoy!

Browse by Category

Archives

Latest Work

hosted by        ©2007-2008 Brian Jeremy Kupetz. All Rights Reserved.

About this site | Google Sitemap