retrieve max sample sn from db