I've searched here and Google for a solution to this. The ones I found I don't like and I want to see if there is a better way. I have an MSSQL database, the first one I've worked with, that I connect to using PHP. It was a small pain getting PHP to work with it but I've configured worse things. As I've been working with MSSQL, I've come to like several things about it. Then, this. How does a SQL not offer a LIMIT and Offset!? The workarounds I found are borderline crazy when you juxtapose the MSSQL query with what can be accomplished with MySQL's LIMIT. I just couldn't make myself implement it until I posted here to see if a MS or SQL guru knows a simpler method without all the nested queries. I thought my saving grace would be PHP's mssql_fetch_batch() but it doesn't seem to be working for me. I was actually using the batch initially and swapped to SELECT TOP n records just to make sure I was getting some data, which I was. I then tried to offset and ran into this problem.
Also, The batch seems to still retrieve all the data. I'm trying to fetch many records without increasing the memory on the server a great deal. Am I better off with a batch and if not how do I use an offset query to pull only a few records at a time like pagination?