SQL Server String Functions

This page lists the commonly used string functions in SQL Server.

  1. CHARINDEX

    The CHARINDEX() function is one of the string functions in SQL Server, which is used to find the position of a substring in a string.
  2. CONCAT

    In SQL Server, the CONCAT() function is used to concatenate two or more strings into one string.
  3. LEFT

    The LEFT() function is a SQL Server function used to extract the characters on the left side of a string.
  4. LEN

    The SQL Server LEN() function is used to return the length (number of characters) of a string expression.
  5. LOWER

    In SQL Server, the LOWER() function is used to convert a string to lowercase.
  6. LTRIM

    In SQL Server, the LTRIM() function is used to remove the leading spaces of a string and return the result.
  7. PATINDEX

    In SQL Server, the PATINDEX() function is used to find the position of a pattern within a string.
  8. REPLACE

    In SQL Server, the REPLACE() function is used to replace specified characters or substrings in a string.
  9. REPLICATE

    The REPLICATE() function is used to repeat a string a certain number of times to generate a new string.
  10. RIGHT

    在 SQL Server 中,RIGHT() 函数用于返回指定字符串的右侧字符。
  11. RTRIM

    RTRIM() is a string function in SQL Server used to remove trailing spaces from a string.
  12. STUFF

    The STUFF() function in SqlServer is used to delete a specified length of characters in a given string and insert new characters at the deleted position.
  13. SUBSTRING

    In SQL Server, the SUBSTRING() function is used to extract a substring from a specified string.
  14. TRIM

    In SQL Server, the TRIM() function is used to remove leading and trailing spaces from a string.
  15. UPPER

    In SQL Server, the UPPER() function is used to convert a string to uppercase letters.