aspx Tutorial

.NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT
Advertise Here

Advertize

{#advanced_dlg.about_title}
by Aamir Hasan   on Wednesday, November 3, 2010
In this example, i have told you how to get top 5 random records using T-SQL query. Let start's open your MS SQL 2008, I have created a virtual table and inserted some dummy data to display a random records. T-SQL DECLARE @EMPLOYEE TABLE(ID BIGINT IDENTITY,FULLNAME NVARCHAR(MAX),BIRTHDAY DATE) INSERT INTO @EMPLOYEE VALUES ('AAMIR HASAN','01-02-1985'), ('AWAIS AHMED','01-11-1990'), ('SABA KHAN','01-11-1991'), ('MAHWISH HASAN','11-01-1989'), ('GILL GATE','12-01-1979'), ('DR.JAMIL SAWAR','11-01-1965'), ('JOHN','01-06-1977'), ('FASIAL KHAN','01-04-1987'), ('NADIA','01-04-1983'), ('SUPROTIMAGARWAL','01-06-1979') SELECT TOP 5* FROM @EMPLOYEE ORDER BY NEWID() SELECT TOP 5* FROM @EMPLOYEE ORDER BY NEWID() SELECT TOP 5* FROM @EMPLOYEE ORDER BY NEWID() Output I have excuted this query three times to see the results that top 5 random records are displaying as shown in above figures.
Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5