-
ASCII
Returns the ASCII code value of the leftmost character of a character expression.
返回字符串最左侧字符的ASCII值
ASCII ( character_expression ) -
CHAR
Returns the single-byte character with the specified integer code, as defined by the character set and encoding of the default collation of the current database.
返回具有ASCII码对应的单字节字符,该代码由当前数据库的默认排序规则的字符集和编码定义。
CHAR ( integer_expression ) -
CHARINDEX
This function searches for one character expression inside a second character expression, returning the starting position of the first expression if found.
返回字符串中第一个符合目标字符串的index
CHARINDEX ( expressionToFind , expressionToSearch [ , start_location ] ) -
CONCAT
This function returns a string resulting from the concatenation, or joining, of two or more string values in an end-to-end manner. (To add a separating value during concatenation, see CONCAT_WS.)
返回字符串组连接
CONCAT ( string_value1, string_value2 [, string_valueN ] ) -
CONCAT_WS
This function returns a string resulting from the concatenation, or joining, of two or more string values in an end-to-end manner. It separates those concatenated string values with the delimiter specified in the first function argument. (CONCAT_WS indicates concatenate with separator.)
拼接字符串,但是添加了分隔符
CONCAT_WS ( separator, argument1, argument2 [, argumentN]... ) -
DIFFERENCE
This function returns an integer value measuring the difference between the SOUNDEX() values of two different character expressions.
根据soundex的值判断两个字符串的相似度,4最大,0最小
DIFFERENCE ( character_expression , character_expression ) -
FORMAT
Returns a value formatted with the specified format and optional culture. Use the FORMAT function for locale-aware formatting of date/time and number values as strings. For general data type conversions, use CAST or CONVERT.
根据格式类型返回日期和时间
FORMAT( value, format [, culture ] ) -
LEFT
Returns the left part of a character string with the specified number of characters.
保留左侧开始的N的字符
LEFT ( character_expression , integer_expression ) -
LEN
返回字符串长度
Returns the number of characters of the specified string expression, excluding trailing spaces.
LEN ( string_expression ) -
LOWER
Returns a character expression after converting uppercase character data to lowercase.
返回字符串中的英文转为小写
LOWER ( character_expression ) -
LTRIM
Removes space character char(32) or other specified characters from the start of a string.
移除字符串开头的空格或者其他指定符号。
LTRIM ( character_expression , [ characters ] ) -
NCHAR
Returns the Unicode character with the specified integer code, as defined by the Unicode standard.
根据ASCII码返回Unicode指定的符号
NCHAR ( integer_expression ) -
PATINDEX
Returns the starting position of the first occurrence of a pattern in a specified expression, or zero if the pattern is not found, on all valid text and character data types.
返回第一个符合pattern表达式的字符串的位置,如果没有返回0
PATINDEX ( '%pattern%' , expression ) -
QUOTENAME
Returns a Unicode string with the delimiters added to make the input string a valid SQL Server delimited identifier.
默认分隔符为[],可以自定义,将字符串外加一个分隔符,用于将普通字符串变为标识符
QUOTENAME ( 'character_string' [ , 'quote_character' ] ) -
REPLACE
Replaces all occurrences of a specified string value with another string value.
替换所有符合pattern的字符。
REPLACE ( string_expression , string_pattern , string_replacement ) -
REPLICATE
Repeats a string value a specified number of times.
重复字符串指定次数。
REPLICATE ( string_expression , integer_expression ) -
REVERSE
Returns the reverse order of a string value.
反转字符串
REVERSE ( string_expression ) -
RIGHT
Returns the right part of a character string with the specified number of characters.
返回从右起数的指定个数的字符
RIGHT ( character_expression , integer_expression ) -
RTRIM
Removes space character char(32) or other specified characters from the end of a string.
trim字符串右部分
RTRIM ( character_expression , [ characters ] ) -
SOUNDEX
Returns a four-character (SOUNDEX) code to evaluate the similarity of two strings.
返回表示两个字符串相似度的一个四字符的值
SOUNDEX ( character_expression ) -
SPACE
Returns a string of repeated spaces.
返回指定个数的空格
SPACE ( integer_expression ) -
STR
Returns character data converted from numeric data. The character data is right-justified, with a specified length and decimal precision.
返回从数字转来的字符
STR ( float_expression [ , length [ , decimal ] ] ) -
STRING_AGG
Concatenates the values of string expressions and places separator values between them. The separator isn't added at the end of string.
不懂,应该与存储过程有关
STRING_AGG ( expression, separator ) [ <order_clause> ]
<order_clause> ::= WITHIN GROUP ( ORDER BY <order_by_expression_list> [ ASC | DESC ] ) -
STRING_ESCAPE
Escapes special characters in texts and returns text with escaped characters. STRING_ESCAPE is a deterministic function, introduced in SQL Server 2016.
转义文本中的指定字符后返回字符串
STRING_ESCAPE( text , type ) -
STRING_SPLIT
A table-valued function that splits a string into rows of substrings, based on a specified separator character.
STRING_SPLIT ( string , separator [ , enable_ordinal ] ) -
STUFF
The STUFF function inserts a string into another string. It deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position.
删除指定长度的字符后,插入新的字符串到被删除的部分
STUFF ( character_expression , start , length , replaceWith_expression ) -
SUBSTRING
Returns part of a character, binary, text, or image expression in SQL Server.
返回字符/二进制/文本或者图片类型的表达式的一部分
SUBSTRING ( expression ,start , length ) -
TRANSLATE
Returns the string provided as a first argument, after some characters specified in the second argument are translated into a destination set of characters, specified in the third argument.
将输入的变量的字符串到第一个变量,第二个变量为指定被替换的字符,第三个是即将新的字符,返回变化后的字符串
TRANSLATE ( inputString, characters, translations ) -
TRIM
Removes the space character char(32) or other specified characters from the start and end of a string.
删除左右两侧空格
Starting with SQL Server 2022 (16.x) Preview, optionally remove the space character char(32) or other specified characters from the start, end, or both sides of a string.
TRIM ( [ characters FROM ] string )
2022 preview:TRIM ( [ LEADING | TRAILING | BOTH ] [characters FROM ] string ) -
UNICODE
Returns the integer value, as defined by the Unicode standard, for the first character of the input expression.
根据Unicode标准为输入表达式的第一个字符返回其int值
UNICODE ( 'ncharacter_expression' ) -
UPPER
Returns a character expression with lowercase character data converted to uppercase.
将字符串中的小写字符转为大写。
UPPER ( character_expression )