Use variable with TOP in select statement in SQL Server without making it dynamic [duplicate]

Yes, in SQL Server 2005 it’s possible to use a variable in the top clause.

select top (@top) * from tablename

Leave a Comment