As someone who develops websites and does a bit of SQL Server, it seems a no brainer to me that SQL Server should support a simple clause that indicates the results should only include a specific range of rows. For example, rows 30 through 39.

As it stands, implementing paging in SQL Server is actually a little beyond many web developers' capability when their main focus is not SQL.

In addition, it would greatly simplify queries that may already be complex due to joins and other conditions.

On top of that, I'm of the opinion that such a clause may stand a better chance of getting optimized internally over time because the logic would be entirely under Microsoft's control.

I brought this up some time ago in another forum and many of the replies seemed to suggest this would not be desirable.

Given that any existing techniques for paging would be left intact, what possible reason could there be for not adding such a clause? And it would be so much better for people like me.

Can anyone thing of a good reason why Microsoft hasn't done this?

2 Answers 2


Microsoft has done this with the next version of SQL Server, codename "Denali", as well as SQL CE 4. Check out the OFFSET & FETCH parts of the ORDER BY clause here: http://msdn.microsoft.com/en-us/library/ms188385(v=sql.110).aspx

  • Well, it's not exactly as simple as I imagined but I'll take it! And I'm very happy to hear that I'm not the only person who agrees this is worthwhile. I eagerly await the arrival of the next version! Thanks. Commented Jan 24, 2011 at 1:14

At this moment SET ROWCOUNT, TOP(), and ROW_NUMBER() can help you :)

Here is some sample from SO

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.