作者: shazi
教学过程中的一段代码:
sql 代码
- declare @strlen int,@return varchar(500),@ii int
- declare @n int,@c char(1),@chn nchar(1),@str varchar(500)
- set @str = '我爱伟大的周星驰'
- select @strlen=len(@str),@return='',@ii=0
- while @ii<@strlen
- begin
- select @ii=@ii+1,@n=63,@chn=substring(@str,@ii,1)
- if @chn>'z'
- begin
-
- select @n = @n +1
- ,@c = case chn when @chn then char(@n) else @c end
- from(
- select top 27 * from (
- select chn = '吖'
- union all select '八'
- union all select '嚓'
- union all select '咑'
- union all select '妸'
- union all select '发'
- union all select '旮'
- union all select '铪'
- union all select '丌'
- union all select '丌'
- union all select '咔'
- union all select '垃'
- union all select '嘸'
- union all select '拏'
- union all select '噢'
- union all select '妑'
- union all select '七'
- union all select '呥'
- union all select '仨'
- union all select '他'
- union all select '屲'
- union all select '屲'
- union all select '屲'
- union all select '夕'
- union all select '丫'
- union all select '帀'
- union all select @chn) as a
- order by chn
- ) as b
-
- end
- else set @c='a'
- set @return=@return+@c
- end
- select @return
-
分享到:
相关推荐
输入汉字字符参数,返回汉字拼音的首字母!
1:该存储过程,支持汉字转全拼和汉字转拼音首字母。 2:汉字转全拼已经经过优化 3:汉字转拼音首字母可以再sql server2000或以上版本使用。 4:汉字转全拼请在sql server 2005或以上版本使用。
SQLServer汉字转全拼音函数;
sqlserver汉字转拼音(绝对的经典直接创建可用)
终于找见啦根据拼音在sqlserver查询汉字
SQL Server中获取多音字拼音首字母.pdf
这是在网上找到的sqlserver2000 拼音码 五笔码,分享给大家
sqlserver 存储过程转拼音首字母 C#转拼音首字母和全拼
利用SQL SERVER实现拼音简码自动转换汉字.pdf
基于SQL Server的中文拼音首字母转化的程序实现.pdf
SqlServer汉字拼音对照表 收录6759个常用汉字,解压后文件为mdf数据库文件,直接附加到SqlServer就可运行。
调用方法:select dbo.fn_GetSZMPY('我是汉字转首字母拼音方法') 调用方法:select dbo.fn_GetSZMPY('我是汉字转首字母拼音方法')
根据汉字获取汉语拼音的首字母,支持多音字 可以自己维护多音字词汇集 使用中有问题可以私信我解决
SQL Server 拼音简码获取函数。
自定义函数,将汉字转换成每个汉语拼音的首字母
所有中文汉字的:工具库 首字母 字符 拼音 sqlserver2005 拼音和汉字的对应 有6000多个汉字
拼音和五笔码转换函数,压缩包中包含所需资源,使用方法:建立压缩包中的表和函数,执行sql就ok啦
sql 2005 汉字转换成拼音首字母 首字母查询
这是我在sql server 2005上实现计算汉字简码的sql函数,并在项目中得到了应用