What is REPLACE in Transact-SQL? It will replace all occurrences of a specified string value with another string value.

The REPLACE syntax

REPLACE (searchedString, foundString, replacedString)

Example,

SELECT REPLACE(‘abcdefghicde’,'cde’,'xxx’);
GO

The returned result is “abxxxfghixxx”. Basically, it replaced all the ‘cde’ with ‘xxx’.

Related Entries