---返回表达式中指定字符的开始位置
select charindex('c','abcdefg',1)
---两个字符的值之差
select difference('bet','bit')
---字符最左侧指定数目
select left('abcdef',3)
---返回字符数
select len('abcdefg')
--转换为小字符
select lower('ABCDEFG')
--去左空格后
select ltrim(' abcdef')
---返回指定第一次出现的开始位置
select patindex('%_cd%','abcdef')
---替换
select replace('abcdef','cd','xx')
---替换多个字符
select replace(replace('@22"33"','@',''),'"','')
--重复表达式
select replicate('abc',4)
---逆向表达式
select reverse('abc')---cba
--返回右侧指定数目
select right('abcd',2)
---去右空格
select rtrim('abcd ')
---soundex代码
select soundex('abd')
--空格字符串
select space(1)
---转换字符串
select str(100)
---删除指定长度字符,并把指定起点插入另一字符
select stuff('abcdef',2,4,'xxx')
---截取字符
select substring('abcdef',2,3)
---转换大写
select upper('abc')
----取时间整数(year,month,day,Hour,minute,second)
select datepart(month,getdate())
---两个时间比较
select datediff(month,'2010-02-01','2010-02-18')
---时间相加减
select dateadd(month,-4,getdate())