If I have an operator, for example:
UPDATE MT FROM My_Table MT INNER JOIN Some_Other_Table SOT ON .... WHERE ....
then, to get the score, I just replace the beginning with the following:
SELECT COUNT(DISTINCT MT.<primary key column>) FROM My_Table MT INNER JOIN Some_Other_Table SOT ON .... WHERE ....
Another option is to simply wrap it in a transaction and immediately issue a ROLLBACK. This may take longer and you will get locks on the table, but you do not risk a typo between your UPDATE and SELECT.
Tom h
source share