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)
 SELECT TOP

Author  Topic 

CLages
Posting Yak Master

116 Posts

Posted - 2004-05-06 : 15:25:05
hi

I know that if i use
Select to 10 * .....

brings me up the first 10 rows,
but i want

SELECT TOP XXX * ......

WHERE XXX SHOULD BE A VARIABLE
THEN I CAN USE ONLY ONE SELECT TOP, CHANGING ONLY XXX TO THE NUMBER OF ROWS I WANT.

IS IT POSSIBLE?

TKS
C. Lages

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-05-06 : 15:31:34
Look up SET ROWCOUNT in Books Online.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -