以下的文章主要是对SQL Server数据库中正确获取汉字字串的拼音声母的正确操作步骤的描述,假如你对SQL Server数据库中正确获取汉字字串的拼音声母的正确操作步骤有兴趣了解的话,你就可以浏览以下的文章了。
CREATEfunctionfGetPy(@strvarchar(500)='') returnsvarchar(500) as begin declare@strlenint,@returnvarchar(500),@iiint declare@cnchar(1),@chnnchar(1) CREATEfunctionfGetPy(@strvarchar(500)='') returnsvarchar(500) as begin declare@strlenint,@returnvarchar(500),@iiint declare@cnchar(1),@chnnchar(1) select@strlen=len(@str),@return='',@ii=0set@ii=0while@ii<@strlen begin select@ii=@ii+1,@chn=substring(@str,@ii,1) if@chn>='吖' select@c=char(count(*)+63)from( selecttop27*from( selectchn='吖'unionallselect'八' unionallselect'嚓' unionallselect'咑' unionallselect'妸' unionallselect'发' unionallselect'旮' unionallselect'铪' unionallselect'丌'--becausehaveno'i' unionallselect'丌' unionallselect'咔' unionallselect'垃' unionallselect'嘸' unionallselect'拏' unionallselect'噢' unionallselect'妑' unionallselect'七' unionallselect'呥' unionallselect'仨' unionallselect'他' unionallselect'屲'--no'u' unionallselect'屲'--no'v' unionallselect'屲' unionallselect'夕' unionallselect'丫' unionallselect'帀' unionallselect@chn )asa orderbychnCOLLATEChinese_PRC_CI_AS)asb whereb.chn<=@chn elseset@c=@chn set@return=@return+@c end return(@return) end
以上的相关内容就是对SQL Server数据库中获取汉字字串的拼音声母的介绍,望你能有所收获。
【编辑推荐】
- SQL Server 2005允许远程的配置流程SQL Server 2005常见错误的破解方案MS SQL Server 2000系统数据类型有哪些?批量修改SQL Server 2005表构架很简单!SQL server DateDiff 函数语法中的命名参数