[dba-SQLServer] leveraging the power of the database versus code

Arthur Fuller artful at rogers.com
Tue Nov 9 10:49:43 CST 2004


Mark Breen wrote:

>Hello Eric,
>
>I am interested in this topic also.
>
>I recently had to create a SQL statement that selected the top n
>number of records.  It was a reasonably complex sql statement
>filtering on a table with 12 million records.
>
>In SQL you can say Select top 10 .... but you cannot say Select top
>@MyValue ....
>  
>
>  
>
One little footnore. In SQL 2005 you can say SELECT TOP @n.



More information about the dba-SQLServer mailing list