Although highly improvable in real use... it seems that both the MSSQL and SQLSRV drivers are exposed to overflow problems when PHP_INT_MAX is used in limit tests.
This is caused by this happening:
So if both exist and they are bigger than PHP_INT_MAX, overflow => error happens.
Fix is really parallel to the one applied @
MDL-26844 for PostgreSQL.
Working on it. Ciao