Getting A Random Row From A MS SQL Table
Published by philipnorton42 on Wed, 01/09/2008 - 10:02To get a random row from a Microsoft SQL database you need to use the NEWID() function. This will generate a new random number for each row and order them by that new number. This is used in conjunction with the TOP clause to limit the amount of returned rows to one.
Category:
Add new comment