IT猫扑网:您身边最放心的安全下载站! 最新更新| 软件分类| 专题汇总| 手机版

您当前所在位置:IT猫扑网 > 数据库 > MSSQL > SQL Server数据库正确获取汉字字串的拼音声母

SQL Server数据库正确获取汉字字串的拼音声母

时间:2015-06-28 00:00 来源:IT猫扑网|http://www.itmop.com/ 作者:网管联盟 我要评论(0)

以下的文章主要是对sql server数据库中正确获取汉字字串的拼音声母的正确操作步骤的描述,假如你对SQL Server数据库中正确获取汉字字串的拼音声母的正确操作步骤有兴趣了解的话,你就可以浏览以下的文章了。

  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数据库中获取汉字字串的拼音声母的介绍,望你能有所收获。

关键词标签:SQL Server,数据库

相关阅读 sql server系统表损坏的解决方法 SQL Server asp.net 数据提供程序连接池 SqlServer2005对现有数据进行分区具体步骤 一个Access数据库数据传递的实例方法 为导入文件加上时间戳标记的两种方法 SQL Server 2005 在不允许远程连接的情况下的破解

文章评论
发表评论

热门文章 sql server系统表损坏的解决方法 sql server系统表损坏的解决方法 SqlServer2005对现有数据进行分区具体步骤 SqlServer2005对现有数据进行分区具体步骤 解决SQL Server中Group无法实现的问题 解决SQL Server中Group无法实现的问题 SQL Server 2005降级到2000的正确操作步骤 SQL Server 2005降级到2000的正确操作步骤 手把手教你学会SQL Server镜像操作 手把手教你学会SQL Server镜像操作 实战手记:让百万级数据瞬间导入SQL Server 实战手记:让百万级数据瞬间导入SQL Server

相关下载

人气排行 配置和注册ODBC数据源-odbc数据源配置教程 如何远程备份(还原)SQL2000数据库 SQL2000数据库远程导入(导出)数据 SQL2000和SQL2005数据库服务端口查看或修改 修改Sql Server唯一约束教程 SQL Server 2005降级到2000的正确操作步骤 sql server系统表损坏的解决方法 浅谈JSP JDBC来连接SQL Server 2005的方法 SQL Server创建表语句介绍 MS-SQL2005服务器登录名、角色、数据库用户、角色、架构的关系 如何使用SQL Server中的客户端配置工具 SQL Server 分布式查询:OLE DB连接(一)