Tech Spot
.Net, C#, SQL, BI and much more......
Tuesday, October 26, 2010
To get random records from a table in Sql Server
With the help of newid() function, each time different records will be genertaed .
This is inbuilt function in sql Server.
Ex:
SELECT Top 5 [name], [salary]FROM [dbo].[dupemp] ORDER BY NEWID()
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment