finish sql script