Fix to SQL where it was using an old method that has been removed.