Loading lesson path
Concept visual
Start at both ends
Replace "T" with "M":
SELECT REPLACE('SQL Tutorial', 'T', 'M');The REPLACE() function replaces all occurrences of a substring within a string, with a new substring.
Formula
The search is case - insensitive.Also look at the STUFF() function.
string, old_string, new_string )
Required. The original string old_string Required. The string to be replaced new_string Required. The new replacement string
SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse
Replace "SQL" with "HTML":
SELECT REPLACE('SQL Tutorial', 'SQL', 'HTML');Replace "a" with "c":
SELECT REPLACE('ABC ABC ABC', 'a', 'c');❮ SQL Server Functions