Text replace

A nice simple post today. This is probably well known, but I useful one to know.

Below is the syntax for the REPLACE function.

DECLARE @TestText NVARCHAR(10) = 'Testx'
SET @TestText = REPLACE(@TestText, 'x', '!')

As you can see, the first parameter is the source string, second is the text to replace, and the third is the text to replace the old.

Subscribe

0 comments