DF#QCADOOMES-756 Added sql after refactor.