Updating sql query locations