-- =============================================
--スカラー関数 (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
@strlen int,
@return varchar(500),
@ii int,
@c char(1),
@chn nchar(1)
--//初期化变量
@pytable table を宣言(
chn char(2) COLLATE Chinese_PRC_CS_AS NOT NULL,
py char(1) COLLATE Chinese_PRC_CS_AS NULL,
PRIMARY KEY (chn)
)
@pytable に挿入 value('吖', 'A')
@pytable に挿入value('八', 'B')
@pytable に挿入values('嚓', 'C')
@pytable に挿入values('