SC#QCADOOCLS-513 Added some fixes to sql.