Home All Groups Group Topic Archive Search About

Can I use WRITETEXT/UPDATETEXT in a Set operation

Author
28 Aug 2006 7:43 PM
kevin
using sql server 2k

I think I already know the answer, but ...

Is there anyway to use WRITETEXT or UPDATETEXT in a set operation like the
following which, of course, doesn't work.

update dbo.mytbl
set txtcol = WRITETEXT dbo.mytbl.txtcol TEXTPTR(txtcol) 'some new text for
colID' + cast(colID as varchar)

I know that I can simply SET the field as normal (and will probably end up
doing that), but I would like to avoid logging if possible.

thanks in advance...
--
kevin...

Author
28 Aug 2006 10:44 PM
Erland Sommarskog
kevin (ke***@discussions.microsoft.com) writes:
> using sql server 2k
>
> I think I already know the answer, but ...
>
> Is there anyway to use WRITETEXT or UPDATETEXT in a set operation like the
> following which, of course, doesn't work.
>
> update dbo.mytbl
> set txtcol = WRITETEXT dbo.mytbl.txtcol TEXTPTR(txtcol) 'some new text for
> colID' + cast(colID as varchar)
>
> I know that I can simply SET the field as normal (and will probably end up
> doing that), but I would like to avoid logging if possible.

No. WRITETEXT works for one value at a time.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx