• Ok, I readjusted my original code to use UPDATETEXT you should be able to take it from there. 

    While I don't understand all your requirements (obviously) this seems like a "strange" way to accomplish what it appears you want to do.  How big is your geral_texto table?  If we are talking about millions of records this is going to be a "very" slow process.  Why update all the records when english is needed, only to change them back the next time spanish is needed (at least that appears to be what you are doing).  Why not just add a column to the table that references (foreign key) your tbl_glossario table and then "repeat" all the entries currently in your geral_texto table for each "language" with the substitutions already made, then when you want "english" just select where they are already in english.  Updating all the records in the table each time a different language is needed seems like unnecssary work.  If you really don't want to store for "every language" you could do a "view" that calculates the changes each time without permenantly storing them.

    Just my opinion, but anyway here is the code:

    if object_id('test_') is not null drop table test_

    create table test_ (pk_ int identity, myText_ text)

    insert into test_ (myText_) values ('This is test1')

    insert into test_ (myText_) values ('This is test2')

    insert into test_ (myText_) values ('This is Value3')

    begin

    declare @findString_ varchar(8000)

    declare @replaceString_ varchar(8000)

    declare @deleteLength_ int

    declare @offSet_ int

    declare @pk_ int

    declare @myTextPtr_ binary(16) --varbinary

    --NOTE: Your outer loop would start here and set the @findString_ and @replaceStr_ variable as appropriate

    set @findString_ = 'test'

    set @replaceString_ = 'My New Words'

    set @deleteLength_ = len(@findString_)

    --This is the inner loop to walk all the appropriate records

    declare cur1_ cursor for

       select pk_, textptr(myText_), patindex( '%' + @findString_ + '%', myText_) - 1

          from test_

          where patindex( '%' + @findString_ + '%', myText_) <> 0

    open cur1_

    fetch next from cur1_ into @pk_, @myTextPtr_, @offSet_

    while @@fetch_status = 0

    begin

     UPDATETEXT test_.myText_ @myTextPtr_ @offSet_ @deleteLength_ @replaceString_

     

     fetch next from cur1_ into @pk_, @myTextPtr_, @offSet_

    end

    CLOSE cur1_

    DEALLOCATE cur1_

    select * from test_

    end