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 / vijendra singh

Use The following Query for the problem...

Declare @PageIndex int
set @PageIndex=1
Declare @PageSize int
set @PageSize=20
while @PageIndex < 1000
begin
SELECT * FROM test WHERE ID between
@PageIndex and @PageIndex+@PageSize-1
set @PageIndex = @PageIndex + 20
end

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the Session state management options available with ASP.NET?

1044


How do u optimize a query in asp.net?

1011


What are the page life cycle events?

915


What are different types of api?

1019


Which is faster union or union all?

1012


Explain about Application and Session Events ?

1076


What language is asp.net written in?

1045


What is a windows service?

1106


Are cookies client side or server side?

908


What is query string? What are its advantages and limitations?

987


What is the use of web.config file?

1017


What is the difference between custom web user control and a custom web server control?

974


Differentiate between a hyperlink control and a linkbutton control.

989


Which class is used to send an email message from an ASP.NET Web page?

1027


How to include silver light .xap page into asp.net web application and what is the purpose of using silverlight application?

2712