The Microsoft documentation indicates that the REPLACE() function accepts and returns only character data types. However, these work without error:
SELECT REPLACE(123456, 'X', 'Y') ; SELECT REPLACE(CAST(123456 AS INT), 'X', 'Y') ;
Furthermore, you can treat the result as an INT, suggesting that the function retained the argument's data type without attempting to convert it:
SELECT REPLACE(123456, 'X', 'Y') / 3 ;
What is not being stated in the Microsoft documentation?