         	
 	SELECT @ptrval = TEXTPTR(text) 
    	FROM texts
-      	WHERE meta_id = @meta_id and name = @name 
+      	WHERE meta_id = @meta_id and name = @name and type =0 
       	
         set @insert_offset = 0		--A value of 0 inserts the new data at the beginning of the existing data
         

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

open posCursor
fetch next from posCursor 

            where meta_id = @meta_id and name = @name                
	    update #tmptexts set newtext = replace((select newtext from #tmptexts where meta_id =@meta_id and name = @name),'&aacute;', '')
            where meta_id = @meta_id and name = @name                               
            update #tmptexts set newtext = replace((select newtext from #tmptexts where meta_id =@meta_id and name = @name),'
<BR>', '
')
        where meta_id = @meta_id and name = @name                               


            select @newtext = newtext 
