Update mapper.php

Re-writes the query if SQL Server