Home  >  Article  >  php教程  >  取得拼音字头的存储过程

取得拼音字头的存储过程

WBOY
WBOYOriginal
2016-06-13 10:04:51906browse

-- =============================================
-- Create scalar function (NWGetPYFirst)
-- =============================================
IF EXISTS (SELECT *
FROM sysobjects
WHERE name = N'NWGetPYFirst')
DROP FUNCTION NWGetPYFirst
GO
CREATE FUNCTION NWGetPYFirst
(@str varchar(500) = '')
RETURNS varchar(500)
AS
BEGIN
Declare @strlen int,
@return varchar(500),
@ii int,
@c char(1),
@chn nchar(1)
--//初始化变量
Declare @pytable table(
chn char(2) COLLATE Chinese_PRC_CS_AS NOT NULL,
py char(1) COLLATE Chinese_PRC_CS_AS NULL,
PRIMARY KEY (chn)
)
insert into @pytable values('吖', 'A')
insert into @pytable values('八', 'B')
insert into @pytable values('嚓', 'C')
insert into @pytable values('

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn