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.
- what limitations row_number()?
- is offset + fetch improved replacement row_number()?
- are there use-cases sufficed using 1 , not other?
- 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
Post a Comment