update code for build delete sql