declare @curvar cursor
declare @tid int
declare @tvita varchar(4000)
declare @s varchar(10)
select @s=char(13)
create table #tmp_table (TeacherID int,TeacherVitaIndex int,TeacherVita varchar(4000))
set @curvar = cursor for
select * from teachervita
open @curvar
fetch next from @curvar into @tid,@tvita
while (@@fetch_status=0)
begin
declare @m int
select @m=1
WHILE CHARINDEX(@s,@tvita)>0
   BEGIN
     INSERT INTO #tmp_table(TeacherID,TeacherVitaIndex,TeacherVita) VALUES(@tid,@m,(LEFT(@tvita,CHARINDEX(@s,@tvita)-1)))
     SET @tvita=RIGHT(@tvita,LEN(@tvita)-CHARINDEX(@s,@tvita))
select @m=@m+1
   END
   INSERT INTO #tmp_table(TeacherID,TeacherVitaIndex,TeacherVita) VALUES(@tid,@m,@tvita)
fetch next from @curvar into @tid,@tvita
end
select * from #tmp_table
drop table #tmp_table
go