This is the new code, it's works but, the type of "geral_texto" field is a text, and the result is smaller then the original. How I change this T-SQL for use UPDATETEXT?
tks,
--Declarando variáveis
DECLARE @idGlossario int
DECLARE @strVocabulo nvarchar(150)
DECLARE CurItens cursor for --Nome do cursor
SELECT id_glossario, vocabulo FROM tbl_Glossario
--Abrindo cursor
OPEN CurItens
--Atribuindo valores do select nas variáveis
FETCH NEXT FROM CurItens INTO @idGlossario, @strVocabulo
--Iniciando laço
WHILE @@FETCH_STATUS = 0
Begin
begin
--Delcarando variáveis
declare @col1_ int
declare @col2_ varchar(8000)
declare cur1_ cursor for --Nome do cursor
select id_geral, geral_texto from tbl_geral
--Abrindo cursor
open cur1_
--Atribuindo valores do select nas variáveis
fetch next from cur1_ into @col1_, @col2_
--Iniciando laço
while @@fetch_status = 0
begin
--print @col2_
update tbl_geral
set geral_texto = replace(@col2_,'' + @strVocabulo + '', '<a href=''' + str(@idGlossario) + '''>' + @strVocabulo + '</a>')
where id_geral = @col1_
fetch next from cur1_ into @col1_, @col2_
end
CLOSE cur1_
DEALLOCATE cur1_
select id_geral,geral_texto from tbl_geral
end
FETCH NEXT FROM CurItens INTO @idGlossario, @strVocabulo
end
--Fechando e desalocando cursor
CLOSE CurItens
DEALLOCATE CurItens