First pass at fixing SQL Server 2000 pagination

This is an attempt to restore SQL Server 2000 pagination while reusing the existing local variables.
Any reason for this change here? Trying to migrate to `.format` instead of the older formatting operator.