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 user control in asp.net?

512


How many web config files can be created for an application?

454


Explain the difference between inline and code behind - which is best in?

504


How do I open an ashx file in windows 7?

573


How to find last error which occurred?

540






What are the different web pages?

495


How ASP and ASP.NET page works? Explain about asp.net page life cycle?

589


How do you handle server controls?

657


Why do we need a web application session?

510


In which event of the page viewstate is available?

468


What would be salary for 8+ years of experience in ASP.NET in different metro city in india?

1987


What are the Types of state management techniques

560


What are the validation controls available in ASP.NET?

543


Explain culture and uiculture values.

547


What is server side session management?

526