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

What are session state modes? List some of the important session state modes of asp.net.

722


Do cookies store passwords?

693


Where is the session stored?

862


Explain the difference between globalization and localization techniques

764


What is caching in asp.net?

763


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

716


What are html helpers in asp.net?

777


Is asp.net and .net the same?

714


What is the asp.net control toolkit?

785


What is a server cookie?

721


Define machine.config in .net?

744


Can more than one person use the same login?

748


What is difference between inproc and outproc?

897


Can we make activex dll also ti execute in some process as that of client ? How can we do?

4467


What is the significance of finalize method in .net?

776