Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

if i have 1000 records and i want to access 20 ata time
from SQL server, what will be the query?

Answer Posted / santosh

u can easily done by the use of Row_number() in sqlserver.

Ex:-

declare @Lower_Bound int,@Upper_bound int
SET @Lower_Bound=1 -- change this as per requirement
SET @Upper_bound=20 -- change this as per requirement
Select Id,Name from(select row_number()over(order by id asc) as Temp_Id,Id,Name from M_Student)
M_Student where Temp_Id >=@Lower_Bound and Temp_Id<=@Upper_bound


Here My Table Name is M_Student(Id,Name) & I have made a Temporary Id column(Temp_Id).Here the result.
Thank U......

If any query then u can connect me through

santosh.primetechsoftware@gmail.com

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I use a proxy server when invoking a web service?

990


What are the new navigation controls in asp.net 2.0?

1002


Why mvc is faster than asp.net? : Asp.Net MVC

1057


What is viewstate information stored?

1074


How do we assign page-specific attributes?

1138


Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?

1081


What is advantage of asp.net?

968


What is session mode in asp.net?

1055


what is silver light when will we use silver light,

1903


Can you explain architecture of your project ?

1127


What is the difference between visual basic and asp.net?

1047


Describe a Windows Service and its lifecycle ?

1148


What is smpte vc-1?

1035


How information about the user's locale can be accessed?

1060


What is the adavantage of using ASP.NET routing?

1173