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)
 textually inadequate

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-04-25 : 10:54:44
I'm just being thick again now but I can't find the answer in BOL (never can until it's pointed out to me - just seems to be yet another mental block)

I have a TEXT field that I want to append some text to (in SQL Server 7)

e.g.
update MyTable
SET
myfield = myfield + 'some text that I want to add at the end'

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

Anyone put me out of my misery?

thanks

steve

A sarcasm detector, what a great idea.

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-04-25 : 11:19:04
Search for the UPDATETEXT function.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-04-25 : 11:23:39
They got pills for that now....

oh wait...textually....never mind



Brett

8-)
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-04-25 : 11:43:07
Or ya could

myfield = myfield + cast('some text that I want to add at the end' as text)

Personally I avoid Text fields like the Plague.

Jim
Users <> Logic
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-04-26 : 03:51:43
Thanks guys (including Brett!). Jim I entirely agree with you about text fields but I have no choice with this one


steve

A sarcasm detector, what a great idea.
Go to Top of Page
   

- Advertisement -