user2435866
user2435866

Reputation: 61

Update ntext column

I'm having an article table which has a ntext column called SearchText which contains the whole article stripped for html.

When iterating through our +60000 articles I forgot to add a column to the SearchText content. I'm now trying to update the table using

update Table 
set SearchText = cast(ForgottenField as ntext) + cast(CHAR(13) as ntext) + SearchText as ntext) 
where ForgottenField <> '' 

But I get the following error:

Operand data type ntext is invalid for add operator.

I have read about UpdateText, but I can't figure out how to write some simple SQL to update the column

Upvotes: 0

Views: 946

Answers (1)

ts4you
ts4you

Reputation: 1

I found this site that helped me out (as I had to update ntext too)

Updating your ntext to varchar and updating like this. update x

set x = convert(varchar(max),x) + ' xxx'

Upvotes: 0

Related Questions