WHILE @@FETCH_STATUS = 0 BEGIN FETCH NEXT FROM cur_text INTO @txtaux IF @txtaux IS NOT NULL SET @txt = @txt + @txtaux END PRINT 'Complete string: ' + @txt>Sergey pointed out one problem - you've got the FETCH in the wrong place within the loop. What value are you seeing for @txt vs. what value do you think you should be seeing? Also, give this a try:
>DECLARE @txt nvarchar(4000) > >SELECT > @txt = @txt + texto >FROM > Universe.dbo.textOdi >WHERE > certif = 'PM115451' > >SELECT @txt >>