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)
 Sql server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-01 : 08:37:59
Galvin writes "How can I limit the number of records retrieved from the sql server2000 database, even after applying the filters?"

Nazim
A custom title

1408 Posts

Posted - 2002-05-01 : 08:46:28
using set rowcount

eg:

set rowcount 50
select column1 from table

will return only 50 records, though there may be more.

SET rowcount 0 will set it back to normal(unlimited)

check BOL for more of it.

--------------------------------------------------------------
Go to Top of Page

tan_bum
Starting Member

5 Posts

Posted - 2002-05-01 : 13:26:30
you could also try

Select Top n * From table Where condition

set n equal any number you wish



tan_bum...in warm and sunny Florida
Go to Top of Page
   

- Advertisement -