After viewing some examples of creating a pagination function with SQL, I have managed to write the following working code:
SELECT *
FROM Services
ORDER BY ServiceDateUpdated DESC
OFFSET @Offset ROWS FETCH NEXT @RecordsPerPage ROWS ONLY;
Today, after working with this line of code for over a year, I have realized that it is not to be used with earlier versions of SQL Server than 2012. My current SQL Server version is 2008.
How can I re-write it to make it work with SQL Server 2008?
Thanks in advance.