mssql

推荐列表 站点导航

当前位置:首页 > 数据库 > mssql >

sql存储过程获取汉字拼音头字母函数

来源:网络整理  作者:网络  发布时间:2020-12-08 00:32
sql存储过程获取汉字拼音头字母函数,需要的朋友可以参考下。...
select dbo.fn_getpy('张三')
when substring(@str,@intLen,1) >= '嚓' then 'C'
(
union all select 'C',N'錯'
end
set @PY=''
select @temp = case
declare @intLenint
union all select 'K',N'穒'
when substring(@str,@intLen,1) >= '妑' then 'P'
as
union all select 'B',N'簿'
begin
declare @strRetnvarchar(4000)
when substring(@str,@intLen,1) >= '垃' then 'L'
set @str=right(@str,len(@str)-1)
return @PY
when substring(@str,@intLen,1) >= '发' then 'F'
union all select 'O',N'漚'
union all select 'G',N'腂'
returns nvarchar(4000)
begin
end)
when substring(@str,@intLen,1) >= '噢' then 'O'
end
union all select 'E',N'樲'
when substring(@str,@intLen,1) >= '嘸' then 'M'
end
union all select 'T',N'籜'
as
when substring(@str,@intLen,1) >= '仨' then 'S'
set @word=left(@str,1)
end
when substring(@str,@intLen,1) >= '帀' then 'Z'
declare @word nchar(1),@PY nvarchar(4000)
答!: 2:
union all select 'P',N'曝'
returns nvarchar(4000)
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
when substring(@str,@intLen,1) >= '铪' then 'H'
union all select 'W',N'鶩'
else rtrim(ltrim(substring(@str,@intLen,1)))
if (ascii(@temp)>127) set @temp = ''
then (
--对于英文中小括号,不生成拼音码
union all select 'D',N'鵽'
when substring(@str,@intLen,1) >= '夕' then 'X'
when substring(@str,@intLen,1) >= '丫' then 'Y'
union all select 'L',N'鱳'
when substring(@str,@intLen,1) >= '咔' then 'K'
when substring(@str,@intLen,1) >= '咑' then 'D'
when substring(@str,@intLen,1) >= '妸' then 'E'
union all select 'S',N'蜶'
--如果非汉字字符,返回原字符
else @word
when substring(@str,@intLen,1) >= '旮' then 'G'
order by PY ASC
Create function fun_getPY ( @str nvarchar(4000) )
) T
--函数
when substring(@str,@intLen,1) >= '八' then 'B'
set @strRet = ''
union all select 'Q',N'囕'
union all select 'H',N'夻'
when substring(@str,@intLen,1) >= '屲' then 'W'
union all select 'Z',N'咗'


when substring(@str,@intLen,1) >= '拏' then 'N'
when substring(@str,@intLen,1) >= '吖' then 'A'
union all select 'J',N'攈'
取汉字拼音首字母的存储过程
when substring(@str,@intLen,1) >= '呥' then 'R'
union all select 'X',N'鑂'
return lower(@strRet)
set @temp = ''
if @temp = '(' or @temp = ')' set @temp = ''
select @strRet = @temp + @strRet
while len(@str)>0
--返回:zs
--WITH ENCRYPTION
union all select 'N',N'桛'
)
go

复制代码 代码如下:

when substring(@str,@intLen,1) >= '他' then 'T'

from
select top 1 PY
when substring(@str,@intLen,1) >= '丌' then 'J'
--调用
where word>=@word collate Chinese_PRC_CS_AS_KS_WS
select 'A' as PY,N'驁' as word
union all select 'M',N'旀'
CREATE function fn_GetPy(@str nvarchar(4000))
union all select 'F',N'鰒'
union all select 'R',N'鶸'
set @intLen = @intLen - 1
union all select 'Y',N'韻'
begin
when substring(@str,@intLen,1) >= '七' then 'Q'
declare @temp nvarchar(100)
while @intLen > 0
set @intLen = len(@str)
end
begin
--对于汉字特殊字符,不生成拼音码

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/sql/mssql/1246.shtml

最新文章
sql server 关于设置null的一 sql server 关于设置null的一

时间:2020-12-28

详解SQL游标的用法 详解SQL游标的用法

时间:2020-12-27

vs code连接sql server数据库步 vs code连接sql server数据库步

时间:2020-12-27

图书管理系统的sqlserver数 图书管理系统的sqlserver数

时间:2020-12-25

详解SQL 通配符 详解SQL 通配符

时间:2020-12-25

sql四大排名函数之ROW_NUM sql四大排名函数之ROW_NUM

时间:2020-12-25

SQLServer数据库处于恢复挂 SQLServer数据库处于恢复挂

时间:2020-12-24

Win10 64位安装个人版SQL20 Win10 64位安装个人版SQL20

时间:2020-12-24

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

sql存储过程获取汉字拼音头字母函数

2020-12-08 编辑:网络

select dbo.fn_getpy('张三')
when substring(@str,@intLen,1) >= '嚓' then 'C'
(
union all select 'C',N'錯'
end
set @PY=''
select @temp = case
declare @intLenint
union all select 'K',N'穒'
when substring(@str,@intLen,1) >= '妑' then 'P'
as
union all select 'B',N'簿'
begin
declare @strRetnvarchar(4000)
when substring(@str,@intLen,1) >= '垃' then 'L'
set @str=right(@str,len(@str)-1)
return @PY
when substring(@str,@intLen,1) >= '发' then 'F'
union all select 'O',N'漚'
union all select 'G',N'腂'
returns nvarchar(4000)
begin
end)
when substring(@str,@intLen,1) >= '噢' then 'O'
end
union all select 'E',N'樲'
when substring(@str,@intLen,1) >= '嘸' then 'M'
end
union all select 'T',N'籜'
as
when substring(@str,@intLen,1) >= '仨' then 'S'
set @word=left(@str,1)
end
when substring(@str,@intLen,1) >= '帀' then 'Z'
declare @word nchar(1),@PY nvarchar(4000)
答!: 2:
union all select 'P',N'曝'
returns nvarchar(4000)
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
when substring(@str,@intLen,1) >= '铪' then 'H'
union all select 'W',N'鶩'
else rtrim(ltrim(substring(@str,@intLen,1)))
if (ascii(@temp)>127) set @temp = ''
then (
--对于英文中小括号,不生成拼音码
union all select 'D',N'鵽'
when substring(@str,@intLen,1) >= '夕' then 'X'
when substring(@str,@intLen,1) >= '丫' then 'Y'
union all select 'L',N'鱳'
when substring(@str,@intLen,1) >= '咔' then 'K'
when substring(@str,@intLen,1) >= '咑' then 'D'
when substring(@str,@intLen,1) >= '妸' then 'E'
union all select 'S',N'蜶'
--如果非汉字字符,返回原字符
else @word
when substring(@str,@intLen,1) >= '旮' then 'G'
order by PY ASC
Create function fun_getPY ( @str nvarchar(4000) )
) T
--函数
when substring(@str,@intLen,1) >= '八' then 'B'
set @strRet = ''
union all select 'Q',N'囕'
union all select 'H',N'夻'
when substring(@str,@intLen,1) >= '屲' then 'W'
union all select 'Z',N'咗'


when substring(@str,@intLen,1) >= '拏' then 'N'
when substring(@str,@intLen,1) >= '吖' then 'A'
union all select 'J',N'攈'
取汉字拼音首字母的存储过程
when substring(@str,@intLen,1) >= '呥' then 'R'
union all select 'X',N'鑂'
return lower(@strRet)
set @temp = ''
if @temp = '(' or @temp = ')' set @temp = ''
select @strRet = @temp + @strRet
while len(@str)>0
--返回:zs
--WITH ENCRYPTION
union all select 'N',N'桛'
)
go

复制代码 代码如下:

when substring(@str,@intLen,1) >= '他' then 'T'

from
select top 1 PY
when substring(@str,@intLen,1) >= '丌' then 'J'
--调用
where word>=@word collate Chinese_PRC_CS_AS_KS_WS
select 'A' as PY,N'驁' as word
union all select 'M',N'旀'
CREATE function fn_GetPy(@str nvarchar(4000))
union all select 'F',N'鰒'
union all select 'R',N'鶸'
set @intLen = @intLen - 1
union all select 'Y',N'韻'
begin
when substring(@str,@intLen,1) >= '七' then 'Q'
declare @temp nvarchar(100)
while @intLen > 0
set @intLen = len(@str)
end
begin
--对于汉字特殊字符,不生成拼音码

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://www.juheyunku.com/sql/mssql/1246.shtml

相关文章

风云图片

推荐阅读

返回mssql频道首页