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)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anthony PerkinsCommented:
You cannot use UPDATE to update text or ntext data.  If the data is in fact longer than 8000 characters for text or 4000 for ntext, than you will have to use UPDATETEXT.  

And if that is the case, I will Scott help you with that :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dba123Author Commented:
who is Scott?
dba123Author Commented:
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
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Anthony PerkinsCommented:
>>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."
dba123Author Commented:
oh y ea... hehe :)

I'm looking upt UPDATETEXT syntax right now...
dba123Author Commented:
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.

we're going to be moving our other databases to SQL 2005.  My DBs are alreadyon 2005.  So is this the only way?
dba123Author Commented:
says to use the .WRITE clause of the UPDATE statement
dba123Author Commented:
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
Anthony PerkinsCommented:
>>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.
dba123Author Commented:
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 a fricking notes table, record by record.
Anthony PerkinsCommented:
>>I'm working with is not varchar, it's text<<
Try converting to varchar(max)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.