What are the differences between the older row_number() and the newer OFFSET + FETCH based pagination in SQL Server? -


i have few questions in context of older row_number (sql server 2008) , newer offset + fetch (sql server 2012) paging mechanism provided sql server 2012.

  1. what limitations row_number()?
  2. is offset + fetch improved replacement row_number()?
  3. are there use-cases sufficed using 1 , not other?
  4. are there performance differences between two? if yes, 1 recommended?

thanks.

using row_number() works fine - it's more work necessary; need write "skeleton" cte around actual query, add row_number() column output set, , filter on that.

using new offset / fetch simpler - , yes, it's better performance, these 2 links can show you:

so overall: if you're using sql server 2012 - should definitely use offset/fetch rather row_number() paging


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -