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)
 How to divide and limit query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-09-12 : 18:33:33
peter padilla writes "how can i query record to limit the query result?
like i have a table with 1000 rows and i want to divide the result in 10 result. in mysql you can do this using the (limit $lower_range, $upper_rage) is this possilbe in ms sql server.
im doing a search engine thing that return a set of the query.
thanxxxxx"

cvraghu
Posting Yak Master

187 Posts

Posted - 2006-09-12 : 19:27:13
Please post the table structure and data.

I assume that you've an sp to retrieve the results. You can try the following options

1. Select top (10) columns
from table
where PK > @InputPK

2. Select columns
from table
where PK between @InputstartPK and @InputendPK

Go to Top of Page
   

- Advertisement -