Skip to content

Latest commit

 

History

History
156 lines (146 loc) · 5.06 KB

File metadata and controls

156 lines (146 loc) · 5.06 KB
title String Functions (Transact-SQL)
description String Functions (Transact-SQL)
author MikeRayMSFT
ms.author mikeray
ms.date 08/15/2016
ms.service sql
ms.subservice t-sql
ms.topic reference
ms.custom
ignite-2025
helpviewer_keywords
functions [SQL Server], strings
strings [SQL Server], functions
string functions
strings [SQL Server]
dev_langs
TSQL
monikerRange >=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric || =fabric-sqldb

String Functions (Transact-SQL)

[!INCLUDE sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw-fabricsqldb]

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

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

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)