[thelist] updating two text fields in MSSQL

mattias at thorslund.us mattias at thorslund.us
Mon Mar 13 17:25:33 CST 2006


Quoting "Canfield, Joel" <JCanfield at PacAdvantage.org>:

> We have two free-form text fields in a web tool, writing to TEXT fields
> in MSSQL (fieldnames DESCRIPT and NOTE.)
>
> I need to make DESCRIPT = DESCRIPT + ' Original Request: ' + NOTE, and
> make NOTE = Left(NOTE,256)
>
> Except, it looks like I'd have to use UPDATETEXT or something funky like
> that because the + string concatenator doesn't work with TEXT data
> types.
>
> Any suggestions?
>


Ah that brings back ugly memories... Sorry that I don't remember the details
anymore but UPDATETEXT sounds right. If I'm not totally mistaken, it handles
one row at the time (hopefully you only need to update one row at the time as
well). So, use a stored procedure, and make it get your "note" and 
append it to
the "descript" column with UPDATETEXT.

Read the documentation twice, and make several test cases.

Mattias




More information about the thelist mailing list