Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
TeenageKicks
Starting Member
9 Posts |
Posted - 2006-01-25 : 09:45:41
|
| Hi,I have a problem that I would like help with.I have to write an SQL Server 2000 stored procedure that returns rows from a table (a SELECT with an ORDER BY). A front end system calls the stored procedure and displays the returned rows. If there is more than one screen's worth of data (ie more than 20 rows returned from the table) then there is a requirement that the stored procedure only returns the rows for the screen ie, for screen 1 I need to return rows 1-20, for screen2 I need to return rows 21-40, screen 3 = rows 41-60.The screen number will be passed into the stored procedure so I can work out what rows to return, the only problem is how can I tell SQL Server to only select the required rows (ie, say rows 21 to 40 from the returned rows). I can't see any arguments that allow selective rows to be returned (apart from TOP).Any ideas??Regards,Chris |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-01-25 : 09:56:21
|
http://weblogs.sqlteam.com/jeffs/archive/2004/03/22/1085.aspxGo with the flow & have fun! Else fight the flow |
 |
|
|
TeenageKicks
Starting Member
9 Posts |
Posted - 2006-01-25 : 10:47:41
|
| Thanks for the help spirit1 - that looks like the solution to my problem! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|