例:select ASCII('A') 结果:65
char(integer_expr) : 返回相同ASCII代码值的字符
例:select char('97') 结果:a
CHARINDEX(expr1,expr2[,start_location]) : 返回字符串中指定表达式的起始位 置
DIFFERENCE(char_expr1,char_expr2) : 比较两个字符串
------0 两个SOUNDEX 函数返回值的第一个字符不同
------1 两个SOUNDEX 函数返回值的第一个字符相同
------2 两个SOUNDEX 函数返回值的第一二个字符相同
------3 两个SOUNDEX 函数返回值的第一二三个字符相同
------4 两个SOUNDEX 函数返回值完全相同同
例:select difference('guo','zguo') 结果:0
left(char_expr,integer_expr) : 返回字符串中从左边开始指定个数的字符
例:select LEFT('guozhan',5) 结果:guozh
len(char_expr) : 返回字符串的长度
例:select len('hello') 结果:5
LTRIM(char_expr) :删除字符串前面的空格 例:select ltrim(' hgfdgh') 结果:hgfdgh
lower(char_expr) :将大写字符数据转换为小写字符数据后返回字符表达式
例:select lower('HELLO') 结果:hello
PATINDEX('%pattern%',expr):返回指定表达式中模式第一次出现的起始位置,如果未找到模式,则返回零
right(char_expr,integer_expr) :返回字符串中从右边开始指定个数的字符
例:select right('hello',3) 结果:llo
REVERSE(char_expr) :将字符表达式求反
例:select reverse('abc') 结果:cba
rtrim(char_expr):删除字符串后面的空格
例:select rtrim('fdkjsfjd ') 结果:fdkjsfjd
space(integer-expr):返回长度为指定数据的空格串
例: select space(2)
STUFF(char_expr1,start,length,char_expr2):在char_expr1中,把从位置start开始,长度为length的字符串用char_expr2代替
例:select stuff('hellogood',2,4,'very') 结果:hvergood
SUBSTRING(expr,start,length):返回指定表达式中从start位置开始、长度为 length的部分
例:select substring('everygood',6,4) 结果:good
STR(float_expr[,length[,decimal]]):把数值变成字符串返回,length是总长度, decimal是小数点右边的位数
例:select str('97.100',5,2) 结果:97.10
UPPER(char_expr):返回将小写字符数据转换为大写的字符表达式
例:select upper('hello') 结果:HELLO