This function is splitting the string 'm1,m2,m3' into
m1
m2
m3
I made few more correction can you check this
create function fun_split
(
@string varchar(20)
)
RETURN char(5)
begin
declare @b int,@c varchar(5), @d varchar(5)
set @d = replace('@string',',','.')
set @b=0
while(@b<4)
begin...