Getting Top N Rows in SQL2K and SQL2K5 [Non Tech Ppl Plz Excuse]

SQL 2K

declare @topN int

set @topN = 10

set rowcount @topN

select * from [TABLE]

/***************************/

SQL 2K5

declare @topN int

set @topN = 5

select top (@topN) * from [TABLE]

Comments

Popular posts from this blog

Page Life Cycle in ASP.NET

Overview of MVC

How to Edit More than 200 Rows in SQL Server 2008

Differences between a Structure and Class

SOLID Principles with C#

MVC Request Execution Stages - Life Cycle

Auto Sequence Number in Grid Control with Paging

ASP.NET MVC Version History

Print Function By JavaScript