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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 UPDATE statement fails on ntext field

Author  Topic 

Fusion
Starting Member

3 Posts

Posted - 2001-12-06 : 19:16:04
Hi,
I have a table named users and it has an ntext field called message. I store data in here that users see when they log on. When I do something like:
UPDATE Users SET Message = Message + '<P>The site will be shutdown on Tuesday for maintenance.</P>'

I get an error:
Invalid operator for data type. Operator equals add, type equals ntext.

Does anyone have any suggestions on how to fix this?

Please note: There's a plus sign between "Message" and "'<P>The site...", but it doesn't show up on the preview for some reason.



robvolk
Most Valuable Yak

15732 Posts

Posted - 2001-12-06 : 19:31:47
Text and ntext columns cannot use standard string operators or functions like + or Len(). You would need to use the WRITETEXT or UPDATEXT commands in order to append the extra text onto the end of the ntext column. Check Books Online, it has good examples of how to use these commands.

Go to Top of Page

Tim
Starting Member

392 Posts

Posted - 2001-12-07 : 00:03:17
do you need ntext?

maybe it would fit into a nvarchar(4000) column?




-------------------------------
Visit nr's cursor wonderland
Go to Top of Page
   

- Advertisement -