当前位置:首页 > 系统运维 > 正文内容

获取汉字字串的拼音声母在SQL Server数据库中

a8116255316年前 (2010-07-12)系统运维8

以下的文章主要向大家讲述的是如何正确获取汉字字串的拼音声母在SQL Server数据库中,此文主要是通过其实际操作代码来引出其正确的操作步骤,以下就是实现其具体操作的内容的描述,希望在你今后的学习中会有所帮助。

CREATE function fGetPy(@str varchar(500)=&#039;&#039;)  returns varchar(500)  as  begin  declare @strlen int,@return varchar(500),@ii int  declare @c nchar(1),@chn nchar(1)  CREATE function fGetPy(@str varchar(500)='')  returns varchar(500)  as  begin  declare @strlen int,@return varchar(500),@ii int  declare @c nchar(1),@chn nchar(1)  select @strlen=len(@str),@return='',@ii=0 set @ii=0 while @ii<@strlen  begin  select @ii=@ii+1,@chn=substring(@str,@ii,1)  if @chn>='吖'  select @c = char(count(*)+63) from (  select top 27 * from (  select chn = '吖' union all select '八'  union all select '嚓'  union all select '咑'  union all select '妸'  union all select '发'  union all select '旮'  union all select '铪'  union all select '丌' --because have no 'i'  union all select '丌'  union all select '咔'  union all select '垃'  union all select '嘸'  union all select '拏'  union all select '噢'  union all select '妑'  union all select '七'  union all select '呥'  union all select '仨'  union all select '他'  union all select '屲' --no 'u'  union all select '屲' --no 'v'  union all select '屲'  union all select '夕'  union all select '丫'  union all select '帀'  union all select @chn  ) as a  order by chn COLLATE Chinese_PRC_CI_AS ) as b  where b.chn <=@chn  else set @c=@chn  set @return=@return+@c   end  return(@return)  end  

以上的相关内容就是对SQL Server数据库的介绍,望你能有所收获。

扫描二维码推送至手机访问。

版权声明:本文由2345好导航站长资讯发布,如需转载请注明出处。

本文链接:http://2345hao.cn/blog/index.php/post/21875.html

分享给朋友:

“获取汉字字串的拼音声母在SQL Server数据库中” 的相关文章

微软今天正式停止对windows 7的主流支持

微软今天正式停止对windows 7的主流支持

北京时间1月13日消息,根据计划,微软将于2015年1月13日正式结束对Windows 7SP1的“主流支持”,而这也标志着“扩展支持”阶段的开始,这个阶段将于2020年1月14日结束。 2013年10月份,微软终止销售独立的Windows 7系统安装包,并要求制造商于2014年10月份停止生...

windows 7系统开机后出现黑屏提示Windows无法启动

windows 7系统开机后出现黑屏提示Windows无法启动

一些用户的Windows 7系统开机后出现黑屏,代码为 Windows无法启动: WindowsSystem32ConfigSystem”。这个问题该如何修复呢?现在小编就给大家分析一下吧。 其实这个代码的意思是引导文件丢失了,引导文件(NTLDR)一般存放于C盘根目录下,是一个具有隐藏和只读属性...

windows 7旗舰版系统提示应用程序错误代码0xc0000409的故障原因

windows 7旗舰版系统提示应用程序错误代码0xc0000409的故障原因

问题现象,具体如下所示:  故障分析: 一般来说,出现这种情况是因为电脑误删系统文件或者是系统文件被顽固木马破坏。       解决方法: 1、下载360安全卫士,找到里面的急救箱开始急救,然后进行修复,完成后重新启动; 2、下载瑞...

windows 7玩网游PING高即网络延时比较高的解决方法

windows 7玩网游PING高即网络延时比较高的解决方法

经常听见有人说用Windows 7玩网络游戏的时候网络延时比较高,也就是ping比平时xp的时候高一点,一直找不到原因,很苦恼。今天我们终于找到理由了,原来是Windows 7的一个服务在作怪,这个服务叫:Multimedia Class Scheduler,就是这个服务让我的PING如此高,问题是...

windows 7系统中不能把程序锁定到任务栏的解决方法图文讲解

windows 7系统中不能把程序锁定到任务栏的解决方法图文讲解

最近小编在使用Windows 7的时侯遇到一个问题,就是应用程序和快捷方式不能锁定到任务栏,我当时不知道怎么回事,但是很多现有的方法都不能解决这个问题。现在我把我的解决的方法分享给大家以作参考。 问题分析 经过思考,初步判断出现该问题的原因是由于使用第三方优化软件消除快捷方式的小箭头引起的。...

Ubuntu 14.04安装Wine以便使用Windows应用

Ubuntu 14.04安装Wine以便使用Windows应用

假如你想要在Ubuntu上使用Windows应用,就需要用到Wine了,除了支持Linux系统外,Wine还可运行于其他系统,是个非常使用的软件,下面小编就以Ubuntu 14.04为例,给大家介绍下Ubuntu 14.04安装Wine的步骤。 Ubuntu 14.04安装Wine的步骤 1...