sql存储过程获取汉字拼音头字母函数
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
相关文章
热门TAG
命令 权重 外链 企业网站 白帽 php 织梦教程 dedecms修改内容 javascript 织梦 功能 标签 调用 详解 服务器 网站流量 实例解析 Dedecms 织梦cms HTML tags标签 python jquery教程 jquery windows SEO优化 蜘蛛 搜索引擎 网站收录 JSP最新文章
-
sql server 关于设置null的一
时间:2020-12-28
-
详解SQL游标的用法
时间:2020-12-27
-
vs code连接sql server数据库步
时间:2020-12-27
-
图书管理系统的sqlserver数
时间:2020-12-25
-
详解SQL 通配符
时间:2020-12-25
-
sql四大排名函数之ROW_NUM
时间:2020-12-25
-
SQLServer数据库处于恢复挂
时间:2020-12-24
-
Win10 64位安装个人版SQL20
时间:2020-12-24
热门文章
-
sqlserver中查询横表变竖表的sql语句简析
时间:2020-12-08
-
关于SQL Server查询语句的使用
时间:2020-12-13
-
SQL Server简单模式下误删除堆表记录恢复方
时间:2020-12-12
-
MSSQL教程_mssql数据库教程_MSSQL基础教程_第
时间:2020-12-13
-
详解SQL游标的用法
时间:2020-12-27
-
sql server 关于设置null的一些建议
时间:2020-12-28
-
jdbc连接sql server数据库问题分析
时间:2020-12-10
-
mssql关于一个表格结构的另外一种显示(表
时间:2020-12-11
-
SQL Server数据库入门学习总结
时间:2020-12-10
-
使用SqlBulkCopy时应注意Sqlserver表中使用缺
时间:2020-12-09
