What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?
From 2012 onward we can use OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY