Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hello all.I have a column named 'RELATED' of type text in a table. I want to update the contents of this colums...........but still keep what is currently stored in it. Basically i want to add some text onto the end of the string it currently contains.Any help would be much appreciated.
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts
Posted - 2006-11-20 : 08:01:45
use UPDATETEXT(). Something like this:
create table #t( a text)insert #t select 'abc'DECLARE @ptrval binary(16), @len intSELECT @ptrval = TEXTPTR(a), @len = datalength(a) from #tUPDATETEXT #t.a @ptrval @len 0 'pqr' select * from #t