ref #232, Updates the SQL