all groups > sql server data warehouse > june 2006 >
You're in the

sql server data warehouse

group:

how to display 10 rows at a time when 1000's returned form sql query


how to display 10 rows at a time when 1000's returned form sql query Daniel
6/7/2006 10:15:28 PM
sql server data warehouse:
how to display 10 rows at a time when 1000's returned form sql query

how to select the 20th-30th row in a where clause? e.g. select the 20th to
30th employee who name is 'bob' in tsql. i need this because my select often
returns 1000s of rows and i want to display them in pages of 10 at a time
but without loading all 1000's into the web app at once!

Re:how to display 10 rows at a time when 1000's returned form sql query thiyagarajan
8/4/2006 4:02:09 AM
for this i have written a stored procedure using sp.just u follow the sp and
give details for it. in rowno you have to give your from which u have to
search and rowget is for how many rows u have to return.

CREATE PROC cursor_lock
@rowno int,
@rowget int
as
declare menu_cursor scroll cursor for
select * from exmenudefn order by menu_id
open menu_cursor
fetch absolute @rowno from menu_cursor
while(@rowget!=0)
begin
fetch next from menu_cursor
set @rowget= @rowget -1
end
close menu_cursor
deallocate menu_cursor


execution has to be like this
-----------------------------
AddThis Social Bookmark Button