DECLARE
@temp
nvarchar
(
500
),
@T
NVARCHAR
(
500
),
@LEN
INT
SET @T = ' @传入字符串 '
SET @LEN = charindex ( ' , ' , @T )
-- -------------单字符接受--------------------------------
IF ( @LEN = 0 AND LEN ( @T ) > 0 )
INSERT Doc(Doc) VALUES ( @T )
-- -------------多知阅人接收----------------------
WHILE ( @LEN > 0 )
BEGIN
SELECT @temp = substring ( @T , 0 , @LEN )
IF ( LEN ( @TEMP ) > 0 )
INSERT Doc(Doc) VALUES ( @temp )
SET @T = SUBSTRING ( @T , @LEN + 1 , LEN ( @T ))
SET @LEN = charindex ( ' , ' , @T )
IF ( @LEN = 0 AND LEN ( @T ) > 0 )
INSERT Doc(Doc) VALUES ( @T )
END
SET @T = ' @传入字符串 '
SET @LEN = charindex ( ' , ' , @T )
-- -------------单字符接受--------------------------------
IF ( @LEN = 0 AND LEN ( @T ) > 0 )
INSERT Doc(Doc) VALUES ( @T )
-- -------------多知阅人接收----------------------
WHILE ( @LEN > 0 )
BEGIN
SELECT @temp = substring ( @T , 0 , @LEN )
IF ( LEN ( @TEMP ) > 0 )
INSERT Doc(Doc) VALUES ( @temp )
SET @T = SUBSTRING ( @T , @LEN + 1 , LEN ( @T ))
SET @LEN = charindex ( ' , ' , @T )
IF ( @LEN = 0 AND LEN ( @T ) > 0 )
INSERT Doc(Doc) VALUES ( @T )
END