How to append to a text field in t-sql SQL Server 2005 How to append to a text field in t-sql SQL Server 2005 sql sql

How to append to a text field in t-sql SQL Server 2005


Try this:

update   tablenameset  fieldname = convert(nvarchar(max),fieldname) + 'appended string'


This should work (link)

Copied from link:

DECLARE @ptrval binary(16)SELECT @ptrval = TEXTPTR(ntextThing)FROM itemWHERE id =1UPDATETEXT table.ntextthing @ptrval NULL 0 '!'GO


in 2005 you should use varchar(max) or nvarchar(max) these columns will work with normal varchar functions. Text and ntext have been deprecated