String Functions (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![yes](media/yes.png)Azure SQL Data Warehouse ![yes](media/yes.png)Parallel Data Warehouse

[!div class=“nextstepaction”] Please help improve SQL Server docs!

The following scalar functions perform an operation on a string input value and return a string or numeric value:

ASCII CHAR CHARINDEX
CONCAT CONCAT_WS DIFFERENCE
FORMAT LEFT LEN
LOWER LTRIM NCHAR
PATINDEX QUOTENAME REPLACE
REPLICATE REVERSE RIGHT
RTRIM SOUNDEX SPACE
STR STRING_AGG STRING_ESCAPE
STRING_SPLIT STUFF SUBSTRING
TRANSLATE TRIM UNICODE
UPPER

All built-in string functions except FORMAT are deterministic. This means they return the same value any time they are called with a specific set of input values. For more information about function determinism, see Deterministic and Nondeterministic Functions.

When string functions are passed arguments that are not string values, the input type is implicitly converted to a text data type. For more information, see Data Type Conversion (Database Engine).

See Also

Built-in Functions (Transact-SQL)