reverse insert and update sql modification