create proc proc_ttt
@str varchar(100)
as
declare @t table(a varchar(100))
declare @i int
set @i=0
while @i<=len(@str)
begin
set @i=charindex(',',@str)
insert @t select ''+left(@str,@i-1) +''
set @str=right(@str,len(@str)-@i)
end
select * from @t
执行:exec proc_ttt '1,2,3,'