I have a table with 1000 rows, and I have a procedure that is called after every two mints, I want to get first ten rows (1-10) for the first time, second time next ten rows (11-20) 3rd time next ten rows (21-30) and so on to 1000th row.
Asked
Active
Viewed 64 times
0
-
Please Google for this and search Stack Overflow; it's been answered dozens of times. – Tim Biegeleisen Mar 11 '16 at 06:02
-
How do you determine which ones are the first ten rows? Please post your table structure and how the rows need to be ordered – Raj Mar 11 '16 at 06:05
-
4There is no SQL Server **2007** - we have SQL Server 7.0, 2000, 2005, 2008, 2008 R2, 2012, 2014 - which one is it really? – marc_s Mar 11 '16 at 06:06
-
1*first ten rows* - order by what? If you want to get the *first* or *next* rows, you must have some ordering - what are you ordering by? Can you show us the table structure, and your stored procedure code? – marc_s Mar 11 '16 at 06:10
-
2Possible duplicate of [How to do pagination in SQL Server 2008](http://stackoverflow.com/questions/2244322/how-to-do-pagination-in-sql-server-2008) – Grax32 Mar 11 '16 at 06:21
-
sorry, actually i have SQL 2008 R2 – Usf Noor Mar 11 '16 at 06:32
-
and i want to order the table on id column – Usf Noor Mar 11 '16 at 06:33
1 Answers
0
You can create a stored procedure with '@PageNumber, @PageSize' as parameters to implement 'Pagination' functionality

Community
- 1
- 1

Abdul Rasheed
- 6,486
- 4
- 32
- 48