bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server TRANSLATE() Function

Example

SELECT TRANSLATE('Monday', 'Monday', 'Sunday'); // Results in Sunday

Definition and Usage

The TRANSLATE() function returns the string from the first argument after the characters specified in the second argument are translated into the characters specified in the third argument.

Note

The TRANSLATE() function will return an error if characters and translations have different lengths.

Syntax

TRANSLATE(
string, characters, translations
)

Parameter Values

ParameterDescription
stringRequired. The input string
charactersRequired. The characters that should be replaced
translationsRequired. The new characters

Technical Details

Works in:SQL Server (starting with 2017)

Previous

SQL Server SUBSTRING() Function

Next

SQL Server TRIM() Function