Sql for Flows and Recovery added