stuff
功能:删除指定长度的字符串并在指定的起始点插入另一组字符
STUFF ( character_expression , start , length , character_expression )
character_expression :操作的字符;
start:删除和插入的起始点;
length:删除的长度;
character_expression :要插入的字符
Eg:
Select stuff("abcdef",2,3,"ghijk")
结果:aghijkef
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
patindex
功能:返回模式在字符串中第一次出现的位置
patindex( '%pattern%' , expression )
pattern:要查找的模式
expression:被找的字符串
Eg:
select patindex('%jinweida%','123jinweida54')
结果:4