sqlserver分割字符串,创建临时表
时间:2020-03-01 22:53:50
收藏:0
阅读:81
create function [dbo].[f_split](@c varchar(max),@split varchar(2))
returns @t table(col varchar(max))
as
begin
while(charindex(@split,@c)<>0)
begin
insert @t
( col
)
VALUES ( SUBSTRING(@c, 1, charindex(@split, @c) - 1)
)
set @c = stuff(@c,1,charindex(@split,@c),‘‘)
end
insert @t(col) values (@c)
return
end
原文:https://www.cnblogs.com/fengjiC/p/12392604.html
评论(0)