Thank you all for your replies!
"The IF is resetting the value of @@rowcount in your case. " - ??? If the "IF" was resetting the @@ROWCOUNT that query would always print "Warning! No rows were updated!!!'", but it prints it only when there was no rows indeed...
I was able to create a query with the variable, I just wanted to know whether I understand it correctly why the @@ROWCOUNT was 0 in the code above.
According to this page - https://learn.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql?view=sql-server-ver15 - the PRINT operator must set it to 0, SELECT - to 1 ( but I always kept getting 0 after SELECT - don't know why) and that was the cause of the "0".