当前位置: 数据库>sqlserver
sqlserver 根据汉字获取拼音的函数
来源: 互联网 发布时间:2014-08-29
本文导语: sqlserver 根据汉字获取拼音的函数,感兴趣的朋友可以参考下。 代码如下: create function f_GetPinYin(@str varchar(500)) returns varchar(500) as begin declare @cyc int,@length int,@str1 varchar(100),@charcate varbinary(20) set @cyc=1--从第几...
sqlserver 根据汉字获取拼音的函数,感兴趣的朋友可以参考下。
代码如下:
create function f_GetPinYin(@str varchar(500))
returns varchar(500)
as
begin
declare @cyc int,@length int,@str1 varchar(100),@charcate varbinary(20)
set @cyc=1--从第几个字开始取
set @length=len(@str)--输入汉字的长度
set @str1=''--用于存放返回值
while @cyc=0XB0A1 and @charcate=0XB0C5 and @charcate=0XB2C1 and @charcate=0XB4EE and @charcate=0XB6EA and @charcate=0XB7A2 and @charcate=0XB8C1 and @charcate=0XB9FE and @charcate=0XBBF7 and @charcate=0XBFA6 and @charcate=0XC0AC and @charcate=0XC2E8 and @charcate=0XC4C3 and @charcate=0XC5B6 and @charcate=0XC5BE and @charcate=0XC6DA and @charcate=0XC8BB and @charcate=0XC8F6 and @charcate=0XCBFA and @charcate=0XCDDA and @charcate=0XCEF4 and @charcate=0XD1B9 and @charcate=0XD4D1 and @charcate
returns varchar(500)
as
begin
declare @cyc int,@length int,@str1 varchar(100),@charcate varbinary(20)
set @cyc=1--从第几个字开始取
set @length=len(@str)--输入汉字的长度
set @str1=''--用于存放返回值
while @cyc=0XB0A1 and @charcate=0XB0C5 and @charcate=0XB2C1 and @charcate=0XB4EE and @charcate=0XB6EA and @charcate=0XB7A2 and @charcate=0XB8C1 and @charcate=0XB9FE and @charcate=0XBBF7 and @charcate=0XBFA6 and @charcate=0XC0AC and @charcate=0XC2E8 and @charcate=0XC4C3 and @charcate=0XC5B6 and @charcate=0XC5BE and @charcate=0XC6DA and @charcate=0XC8BB and @charcate=0XC8F6 and @charcate=0XCBFA and @charcate=0XCDDA and @charcate=0XCEF4 and @charcate=0XD1B9 and @charcate=0XD4D1 and @charcate