sql exception

fix some sql exception