Link to home
Start Free TrialLog in
Avatar of expertsit
expertsit

asked on

Appending two strings in SQL

I would like to update a column in a table with a string. Later on I would like to add to that string.

I tried the following query,

"update TABLE1 set COLUMN1 = COLUMN1 + 'TEST STRING'  where ID = 100"

I get this error, "Invalid operator for data type. Operator equals add, type equals text."

The 'COLUMN1' is of type text.

Any help is appreciated.

thanks,
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

>The 'COLUMN1' is of type text.

do you need to have TEXT as data type?
is varchar(8000)   in sql server 2000 resp varchar(max) in sql server 2005 not enough?
Avatar of expertsit
expertsit

ASKER

I cannot change the design of the table. I dont have rights. Is it not possible to add two text fields?

thanks,
ASKER CERTIFIED SOLUTION
Avatar of CIC Admin
CIC Admin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. That worked.
>Is it not possible to add two text fields?
as shown it is possible, but you will only get up to 8000 characters in that field. if you try to store more, it will get truncated...