Found a bit of interesting MS SQL Server / T-SQL behavior on @@ROWCOUNT function.
As we know, @@ROWCOUNT function is used to get the number of affected row by the last statement (or number of result row if the last statement is a SELECT statement).
However, if the statement issued inside a TRY..CATCH block, and the @@ROWCOUNT function called outside that block, then the @@ROWCOUNT will always return 0. Of course there are many ways to get the correct row count, but I’ll choose the easiest one here.