Fixes #4212: MSSQL query builder should not generate the `ORDER BY` clause when it is not needed