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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Beyond TOP

Author  Topic 

evanburen
Posting Yak Master

167 Posts

Posted - 2010-04-16 : 10:34:11
I'm producting a list of records in a .aspx page which gets converted to a PDF file. I need to limit the number of records on the page so that a page break does not occur in the middle of the list of records. Roughly, 25 records fit on a page but then I need to create a separate stored procedure to call on the second page calling records 26 - ?. I'm using SQL Server 2000 and I'm not sure how I would even get started with this. Thanks

SELECT TOP 25
activeceo,
id_company,
dirfullname
FROM
v_CurrentDirectors
WHERE
id_company = @id_company
ORDER BY
dirfullname

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-04-16 : 10:36:14
try http://weblogs.sqlteam.com/jeffs/archive/2004/03/22/1085.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

evanburen
Posting Yak Master

167 Posts

Posted - 2010-04-16 : 10:45:42
Thanks. We really need to upgrade to 2005. ROW_NUMBER looks much easier.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-04-16 : 10:53:53
quote:
Originally posted by evanburen

Thanks. We really need to upgrade to 2005. ROW_NUMBER looks much easier.


Also see how you can effectively make use of row_number() for various purposes
http://beyondrelational.com/blogs/madhivanan/archive/2007/08/27/multipurpose-row-number-function.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

evanburen
Posting Yak Master

167 Posts

Posted - 2010-04-16 : 11:05:40
Is this safe to use? That dynamic SQL looks like a SQL injection attack waiting to happen.
Go to Top of Page
   

- Advertisement -