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

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

成都创新互联专注为客户提供全方位的互联网综合服务,包含不限于做网站、网站制作、宁德网络推广、小程序制作、宁德网络营销、宁德企业策划、宁德品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联为所有大学生创业者提供宁德建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com

 
 
 
  1. CREATE function fGetPy(@str varchar(500)='')  
  2. returns varchar(500)  
  3. as  
  4. begin  
  5. declare @strlen int,@return varchar(500),@ii int  
  6. declare @c nchar(1),@chn nchar(1)  
  7. CREATE function fGetPy(@str varchar(500)='')  
  8. returns varchar(500)  
  9. as  
  10. begin  
  11. declare @strlen int,@return varchar(500),@ii int  
  12. declare @c nchar(1),@chn nchar(1)  
  13. select @strlen=len(@str),@return='',@ii=0 
  14. set @ii=0 
  15. while @ii<@strlen  
  16. begin  
  17. select @ii=@ii+1,@chn=substring(@str,@ii,1)  
  18. if @chn>='吖'  
  19. select @c = char(count(*)+63) from (  
  20. select top 27 * from (  
  21. select chn = '吖' 
  22. union all select '八'  
  23. union all select '嚓'  
  24. union all select '咑'  
  25. union all select '妸'  
  26. union all select '发'  
  27. union all select '旮'  
  28. union all select '铪'  
  29. union all select '丌' --because have no 'i'  
  30. union all select '丌'  
  31. union all select '咔'  
  32. union all select '垃'  
  33. union all select '嘸'  
  34. union all select '拏'  
  35. union all select '噢'  
  36. union all select '妑'  
  37. union all select '七'  
  38. union all select '呥'  
  39. union all select '仨'  
  40. union all select '他'  
  41. union all select '屲' --no 'u'  
  42. union all select '屲' --no 'v'  
  43. union all select '屲'  
  44. union all select '夕'  
  45. union all select '丫'  
  46. union all select '帀'  
  47. union all select @chn  
  48. ) as a  
  49. order by chn COLLATE Chinese_PRC_CI_AS ) as b  
  50. where b.chn <=@chn  
  51. else set @c=@chn  
  52. set @return=@return+@c   
  53. end  
  54. return(@return)  
  55. end  

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

【编辑推荐】

  1. SQL Server数据修复命令DBCC的使用
  2. SQL Server数据整理的操作方案描述
  3. SQL Server 易混淆的一些数据类型有哪些?
  4. SQL Server 日期操作全接触,嘻嘻
  5. 对SQL Server 2005 BI的描述

网页标题:获取汉字字串的拼音声母在SQL Server数据库中
网页网址:http://www.hantingmc.com/qtweb/news0/493300.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联