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 does asp page work?

985


witch is the best insistute in sharpoint course.what abt future of share point course.

3468


What is the significance of attaching a profile while creating a user?

1049


What is the difference between cookie and session?

982


What is asp according to you?

1041


Explain the use of resource manager class in .net.

983


To redirect the user to another page which method do we use without performing a round trip to the client?

934


How does a web application session work?

1093


What is an imagemap in asp.net?

1145


What are the advantages and disadvantages of session?

1128


What is redirectpermanent in asp.net?

1072


Which platform does Microsoft .NET use for exchanging data between applications?

1048


What is an axd file?

1103


What is caching? Explain.

982


In a webservice, need to display 10 rows from a table. Which is the best choice among datareader or dataset?

1190