I am looking into doing some efficient paging and found this link that says the “Holy Grail” is the best approach.
http://www.sqlservercentral.com/articles/T-SQL/66030/
Is the table just being used as an example, or is it actually part of the solution. What I mean is how would you do this with a table that has many joins, same approach? Can someone post an example?
Table “[INFORMATION_SCHEMA].columns” is just being used as an example.
I’d use the same approach for a table that has many joins. Just make sure you have proper indexes.
“Holy Grial” solution just gives you paged results plus a column indicating the total of rows, without overhead. You can get the total of rows on another query.
Be aware of the article conclusion’s: