最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
取得一段汉语的每个字的首字母
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
由于一个公司的OA上用到速查编码,必须得到每个字的首字母,便于以后的查询(如:开发部,则为KFB),到网上找到了一些资料,是一个存储过程。
存储过程为:
CREATE proc LOG_FindCode
@strName nvarchar(20),
@strFindCode nvarchar(20) output
as
begin
declare @word nchar(1),@PY nvarchar(4000)
set @PY=''
while len(@strName)>0
begin
set @word=left(@strName,1)
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
then (select top 1 PY from (
select 'A' as PY,N'
存储过程为:
CREATE proc LOG_FindCode
@strName nvarchar(20),
@strFindCode nvarchar(20) output
as
begin
declare @word nchar(1),@PY nvarchar(4000)
set @PY=''
while len(@strName)>0
begin
set @word=left(@strName,1)
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
then (select top 1 PY from (
select 'A' as PY,N'
相关文章
- C#复制数组的两种方式及效率比较解读 10-24
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- C语言中atoi函数模拟实现介绍 10-18
- .Net反向代理组件Yarp用法介绍 10-10
- .NET使用YARP通过编码方式配置域名转发实现反向代理教程 10-10