 while @@fetch_status = 0
    begin
         insert into #tmptexts (meta_id, name, text, newtext)
-        select @meta_id, @name, text, '' from texts where meta_id =@meta_id and name = @name
+        select @meta_id, @name, text, '' from texts where meta_id =@meta_id and name = @name and type =0
                
 	
         select @oldtext = substring(text,@start,1000), @length = len(substring(text,@start,1000))
        	from #tmptexts 
-       	where meta_id = @meta_id and name = @name
+       	where meta_id = @meta_id and name = @name 
        	
         update #tmptexts set newtext = @oldtext where meta_id =@meta_id and name = @name        
         

for select meta_id, name
    from texts
    where meta_id > 1000  -- = @meta_id  

open posCursor
fetch next from posCursor 

/*
Change extended characters in column texts.text where meta_id > 1000 and type=0 (0=text, 1=html)
and in column meta.meta_headline and meta.meta_text where meta_id > 1000
*/

-- table texts
