--删除测试 drop table #t
--分拆处理 declare @i int select @i=max(len(tpno)) from tr_job set rowcount @i select id=identity(int) into #t from syscolumns a,syscolumns b set rowcount 0 select a.jobno ,tpno=substring(a.tpno,b.id,charindex(',',a.tpno+',',b.id)-b.id) from tr_job a,#t b where b.id<=len(a.tpno) and substring(','+a.tpno,b.id,1)=','