declare @str varchar(8000)
set @str='171,180,13,15,212'
set @str='insert into tb(num) select '+replace(@str,',',' union all select ')
exec( @str)
set @str='171,180,13,15,212'
set @str='insert into tb(num) select '+replace(@str,',',' union all select ')
exec( @str)
set @s=''
select @s=@s+','+Num from 表
set stuff(@s,1,1,'')
select @s
set @s='171,180,13,15,212'
select @result= 'select '''+replace(@s,',',''' union all select ''')+''''
exec(@result)/*
171
180
13
15
212
*/
declare @str varchar(8000)
set @str='171,180,13,15,212'
set @str='insert into tb(num) select '+replace(''''+@str+'''',',',''' union all select ''')
exec( @str)