Question : Insert Text String into ntext field

I need to insert some text into an ntext field for selected records in a table. I tried the SQL Statement below but it doesn't seam to work for me in every case, it needs to work where fieldname has no value, or null value, or an existing text value.

update tablename set fieldname= '--Text to Insert--  ' + cast(fieldname as nvarchar(4000))

Thank You,
BRAD

Answer : Insert Text String into ntext field

DECLARE @ptrval binary(16)
UPDATE orders SET admincomments = '' WHERE idorder = 87057 AND admincomments IS NULL
SELECT @ptrval = TEXTPTR(admincomments) FROM orders WHERE idorder = 87057
UPDATETEXT orders.admincomments @ptrval 0 0 '---- text to insert ---'
GO
Random Solutions  
 
programming4us programming4us