replace() function
The replace() function replaces each instance of a pattern in the input with the value in the string replacement.
Syntax
The replace() function has the following
syntax:
varchar = replace(varchar input, varchar pattern, varchar
replacement);
nvarchar = replace(nvarchar input, nvarchar pattern, nvarchar
replacement);
The input value specifies the
varchar or nvarchar value in
which to replace the characters.
The pattern value specifies
the characters to replace.
The replacement value specifies
the characters to substitute
for each instance of the pattern value.
Returns
The function replaces the instances of the pattern in the input.
Example
select replace('persisaent','a','t');
REPLACE
------------
persistent
(1 row)