updated sql generator to return record during insert and update operation