Thank you a lot.
It seems Merge statement is a very helpful tool for data update/delete/insert load.
But at the same time, I understand it is not so flexible to add other codes into it. This one is an example.
You code is certainly a great help, I will give it a try.
Thanks