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
 SQL Server Development (2000)
 Top Clause and Derived tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-05 : 00:23:03
Chris writes "How can I supply parameters to my top clauses?
My goal is to allow for paging results.

The parameters would be pageSize and pageRequested

SELECT FirstName, LastName
FROM (
SELECT TOP 10 FirstName, LastName
FROM (
SELECT TOP 100 FirstName, LastName
FROM Person_t
ORDER BY FirstName ASC
) x
ORDER BY FirstName DESC
) y
ORDER BY FirstName ASC"
   

- Advertisement -