Try it this way. The example works, it just replaced the searched for value 'ccc' with 'xxxxxx'. To delete characters at the end, you find them and replace them with ''.
CREATE TABLE #temp (rowid int,textcol ntext)
INSERT INTO #temp values (1,'aaa bbb ccc ddd eee !!end field!!')
DECLARE @from nvarchar(100), @to nvarchar(100), @pos int, @len int
SET @from='!!end field!!'
SET @to = '' --- don't replace with 'xxxxxx', replace with emptiness
SELECT @pos = CHARINDEX(@from,textcol)-1 FROM #temp WHERE rowid = 1
SET @len = LEN(@from)
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(textcol) FROM #temp WHERE rowid = 1
UPDATETEXT #temp.textcol @ptrval @pos @len @to
SELECT * FROM #temp
DROP TABLE #temp
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills