I was having issues doing two different select queries with batch sizes in the same connection. The first one would run fine, the second one would always return one batch + 1 record (ie. batch size on the 2nd query was 250000 records, it would stop after 250001 and say it was complete even though there should have been 3m+ records).

I was able to overcome this by disconnecting from the DB (via mssql_close($conn);) and reconnecting before I ran the second query. Now my second query returns all the records I need.

Though I would write this here as there is little to no documentation on this issue, and it may only be affecting me. I am connecting from Linux (RHEL5) to SQL Server 2005 on the network, using FreeTDS. If you have this same issue, try the above and it may work for you.