bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server TRANSLATE() Function

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind SQL Server TRANSLATE() Function?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ TRANSLATE('Monday', 'Monday', 'Sunday'); // Results in Sunday
3Order

Put the learning moves in the order that makes the concept easiest to apply.

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.
Definition and Usage
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