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

What is class and object in asp.net?

1172


What is Partial PostBack in ASP.NET?

1045


How to disable disable browser's Back button in asp.net (JavaScript)?

1131


How to you can limit Access to Web API to Specific HTTP Verb?

1181


Write some code using interfaces, virtual methods, and an abstract class`

2043


Why is the standalone environment only useful during the development process?

1828


Explain serialization and deserialization?

1017


What events will occur when a page is loaded?

1035


What is the difference between mvc and asp.net? : Asp.Net MVC

1010


What is session start?

967


What is difference between Lambda Expression and LINQ in ASP.NET?

1201


To display data in a Repeater control which template you provide?

1036


How are sessions stored?

989


Explain the asp.net mvc folder conventions? : asp.net mvc

1000


Explain how caching in asp.net 2.0 is different from caching in asp.net 1.1?

974