Home > DeveloperSection > Forums > How to selecte random records from SQL Server table?
Tanuj Kumar

Total Post:134

Posted on    March-24-2012 1:48 AM

 MSSQL Server MSSQL Server 

 1 Reply(s)
 1535  View(s)
Rate this:
Hello Everyone,
I want to select records randomly from my SQL Server table. Could you explain it with the code that how to do it?

Thanks in advance!!

Arun Singh

Total Post:68

Posted on    March-26-2012 1:19 AM

Hi Tanuj Kumar,
In SQL Server database, there is a function NEWID() through which we can select SQL table record randomly.
Query: select * from tbl_Name order by newid()
I hope it might be resolve your problem.

Don't want to miss updates? Please click the below button!

Follow MindStick