More SQL errors checks