.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

How to get the random record from sql server?

Posted By: Deco     Posted Date: October 27, 2010    Points:2   Category :Sql Server
Please send me the code to get the random record from sql server.
I have 100 questions in the table, i need to select 10 questions in random order.

Responses
Author: Syed Shakeer Hussain             
Posted Date: October 27, 2010     Points: 5   

Hi,

Run the Below Query to Get Random Records

SELECT TOP 10 questionId from tablename ORDER BY NEWID()





Author: Deco             
Posted Date: October 27, 2010     Points: 5   

Thanks Shakeer

Regards,
Deco
Author: Syed Shakeer Hussain             
Posted Date: October 27, 2010     Points: 5   

Hi,

If you got a Answer, plz mark it as a Answer.




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend