sqlfriends (1/9/2012)
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.
It would certainly be nice to be able to use GROUP BY $action and COUNT directly on the output, that's true.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi