当前位置:Gxlcms > PHP教程 > 取得拼音字头的存储过程_PHP教程

取得拼音字头的存储过程_PHP教程

时间:2021-07-01 10:21:17 帮助过:20人阅读

-- =============================================
-- 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('

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631228.htmlTechArticle-- ============================================= -- Create scalar function (NWGetPYFirst) -- ============================================= IF EXISTS (SELECT * FROM sysobjects WHERE...

人气教程排行