SONAR-3755 fix SQL for mssql and oracle