How to append data from a varchar column to a text column

I have a varchar(1000) column with data that I need to append to a text column in the same table.  How do I do it?

I have tried

UPDATE    Person
SET              Comments = Comments + ' - ' + Web


but that gives me the 'invalid operator for data type' error.  I tried ampersands as well.
LVL 1
abenageAsked:
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.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
you cannot "append" to TEXT fields... with UPDATE, you need UPDATETEXT:
http://technet.microsoft.com/en-us/library/ms189466.aspx

will not be as easy as that...
0

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
Rick_RickardsCommented:
If you're willing to create an ODBC connection and then use Access to link to the SQL Server table in question you may find the task to be considerably simpler.  In such a case a query like the one below will do the job...

UPDATE [YourTableNameHere] SET [YourTableNameHere].[Comments] = [YourTableNameHere].[Comments] & " - " & [YourTableNameHere].[Web];
0
Rick_RickardsCommented:
If you'd prefer not to use the Access approach you could create a view like the one below...

SELECT     Comments, Comments + N' - ' + Abv AS CommentsAndWeb
FROM         dbo.YourTableName

After you run the query you can the copy and paste the contents from the 2nd column named CommentsAndWeb and Paste them into the 1st column named Comments
0
Anthony PerkinsCommented:
Rick_Rickards,
Unfortunately, you cannot concatenate values with a data type of text.

As angelIII has pointed out the only way to do it in SQL Server 2000 is using UPDATETEXT.

If the text is not more than 8000, than you can CAST to varchar(8000) before concatenating.
0
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
Query Syntax

From novice to tech pro — start learning today.