SQL Server String function quick query

Source: Internet
Author: User
SQL Server String functions are listed in different categories for easy access and memory. I believe everyone has a deep programming Foundation in other aspects. Literally, everyone knows the meaning of these functions, I have not explained these functions too much. I will focus on some experiences. For more information, see books online.

ASCII (character_expression)Returns the ASCII of the leftmost character.CodeValue
Char (integer_expression)

Unicode (ncharacter_expression)Returns the integer of the first character of the input expression, as defined in the Unicode standard.
Nchar (integer_expression)

Lower (character_expression)Returns the string in lowercase.
Upper (character_expression)

Ltrim (character_expression)Truncates left-side spaces.
Rtrim (character_expression)

Len (string_expression)Returns the number of characters (not bytes), excluding trailing spaces.
Left (character_expression, integer_expression)Trailing spaces may also be returned.
Right (character_expression, integer_expression)
Substring (expression, start, length)The first character is at 1.

Charindex (expression1, expression2 [, start_location])Position of expression1 in expression2. if no value is found, 0 is returned.
Patindex (% pattern %, expression)Pattern should have wildcards, like
Reverse (character_expression)Reverse string
Replace (string_expression, string_expression2, string_expression3)Replace the second expression in the first expression with the third expression
Stuff (character_expression, start, length, character_expression)Press Start and length to delete the content of the first expression and insert the fourth expression at the start position.

Replication (character_expression, integer_expression)Duplicate string
Space (integer_expression)Repeat integer_expression with spaces

Soundex (character_expression)Returns a specific string of four lengths Based on the string.
Difference (character_expression, character_expression)Compare the return values of the two expressions in sounex with several different characters. The return value is [0-4].

STR (float_expression [, length [, decimal]) returns the string value converted from a number.
quotename (character_string [, quote_character]) returns the Unicode string with a separator.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.