您当前的位置: 首页 > 

汉字转拼音首字母

发布时间:2011-09-06 12:34:03 ,浏览量:0

Create function [dbo].[fun_getPY](@str nvarchar(4000)) 
returns nvarchar(4000) 
as 
begin 
declare @word nchar(1)
declare @PY nvarchar(4000) 
set @PY=''
while len(@str)>0 
begin 
    set @word=left(@str,1)

    --如果非汉字字符,返回原字符 
    set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901 
then ( 
                            select top 1 PY 
                            from 
                            ( 
                         select 'A' as PY,N'驁' as word 
                     union all select 'B',N'簿' 
                     union all select 'C',N'錯' 
                     union all select 'D',N'鵽' 
                     union all select 'E',N'樲' 
                     union all select 'F',N'鰒' 
                     union all select 'G',N
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    108697博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0699s