Library code snippets
Randomly Sorting Records
By James Crowley, published on 25 Mar 2005
Ever needed to grab a selection of random rows from a table? Well, it's surprisingly easy in SQL Server 2000, using the NEWID() method. The code below selects 10 random rows from "myTable".
SELECT TOP 10 id,title FROM myTable ORDER BY NEWID()
Great!
Related articles
Related discussion
-
VS.NET/sql server installation problem
by daspeac (4 replies)
-
Research topic in software
by reachsangeethamathew (0 replies)
-
Job Opening - New Braunfels, Tx for C# Programmer
by kirkkelly (3 replies)
-
update database when the website is nor running on the browser
by hepsy.i (1 replies)
-
Graphical Reports in C# .net
by gulshanuetian (0 replies)
Related podcasts
-
ADO.NET "Astoria" Data Services with Shawn Wildermuth
Scott chats with Shawn Wildermuth, "the ADO Guy," about ADO.NET Data Services, aka "Project Astoria." It's REST for SQL Server. Should you care? What's REST? How does this relate to WCF or ASP.NET?
This thread is for discussions of Randomly Sorting Records.