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
SELECT
REPLACE ('Hello', 'e', '!'), -- missing comma in the original query
REPLACE(
CASE
WHEN 1 = 1 THEN 'Hello'
ELSE 'Bye'
END, 'e', '!' -- removed the AS clause
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With