Just as titled, is it possible?
So is like the following:
SELECT
REPLACE ('Hello', 'e', '!')
REPLACE(
CASE
WHEN 1 = 1 THEN 'Hello'
ELSE 'Bye'
END AS MyStr, 'e', '!'
)
Because it returns:
Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword
‘CASE’.
You have syntax errors in your query, but apart from that things look correct. It should be