The 'sqlsrv' query objects have no additional methods specific to Microsoft SQL
Server. However, limit()
and offset()
behaviors are somewhat modified.
In general, limit()
and offset()
with Microsoft SQL Server are best
combined with orderBy()
. The limit()
and offset()
methods on the
Microsoft SQL Server query objects will generate sqlsrv-specific variations of
LIMIT ... OFFSET
:
-
If only a
LIMIT
is present, it will be translated as aTOP
clause. -
If both
LIMIT
andOFFSET
are present, it will be translated as anOFFSET ... ROWS FETCH NEXT ... ROWS ONLY
clause. In this case there must be anORDER BY
clause, as the limiting clause is a sub-clause ofORDER BY
.