Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

Invalid operator for data type. Operator equals add, type equals text.

Why do I get the error "Invalid operator for data type. Operator equals add, type equals text."
when trying to append to my field (varchar)?

UPDATE notes
SET note = note + 'some text here'
from notes h INNER JOIN phones p on h.[number] = p.[number]
where (p.gpi is null or p.gpi = 1)
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

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
Avatar of dba123
dba123

ASKER

who is Scott?
Avatar of dba123

ASKER

hmm, didn't know that even existed. So then yes, how would I use that?  The field is pf type (text, null) actually, not varchar
UPDATETEXT
>>who is Scott?<<
That is like saying here Who is God? :)

You just finished thanking him 10 minutes ago:
"Scott, thanks a lot.  That helps me a lot, and allows me to understand more."
Avatar of dba123

ASKER

oh y ea... hehe :)

I'm looking upt UPDATETEXT syntax right now...
Avatar of dba123

ASKER

here's an interesting note from BOL:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use the large-value data types and the .WRITE clause of the UPDATE statement instead.

http://msdn2.microsoft.com/en-us/library/ms189466.aspx

we're going to be moving our other databases to SQL 2005.  My DBs are alreadyon 2005.  So is this the only way?
Avatar of dba123

ASKER

says to use the .WRITE clause of the UPDATE statement
Avatar of dba123

ASKER

hmm. I may be out of luck with that one though:

.WRITE (expression,@Offset,@Length)
Specifies that a section of the value of column_name is to be modified. expression replaces @Length units starting from @Offset of column_name. Only columns of varchar(max), nvarchar(max), or varbinary(max) can be specified with this clause. column_name cannot be NULL and cannot be qualified with a table name or table alias.

the field I'm working with is not varchar, it's text
>>My DBs are alreadyon 2005.  So is this the only way?<<
You are right.  I mislead you.  What I told you was true for SQL Server 2000 only.
Avatar of dba123

ASKER

oh, cool.  That's good.  I don't want to update stupid memo fields anyway, my boss is out of luck.  They need to get 3rd party apps with correctly designed notes...in a fricking notes table, record by record.
>>I'm working with is not varchar, it's text<<
Try converting to varchar(max)