Updating sql calls