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)
 Text This

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-05-24 : 11:06:17
I'm having great deal of trouble with a TEXT field on my SQL server 7

What I want is the TEXT equivalent of

UPDATE MyTextField
SET MyTextField = MyTextField + 'Some other text'
WHERE ...

but I keep getting errors, it either doesn't like the + operator or it won't convert the 'Some other text' to a text datatype. I've looked at BOL but just get confused. Surely there is a relatively simple way of doing this. Anyone have any clues?

thanks

steve

A sarcasm detector, what a great idea.

nr
SQLTeam MVY

12543 Posts

Posted - 2005-05-24 : 11:24:56
updatetext
see
http://www.mindsdoor.net/SQLTsql/InsertTextData.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-05-24 : 11:35:25
Cheers Nigel I'll take a look at that

steve

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

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-05-24 : 14:44:14
steve - do you have to use text??

all - are there efficiency problems with using a series of varchar(8000) fields or the like...
for example something that was 10000 characters would take 2 rows... maybe 7000 characters on the first and the last 3000 on the second? Then the standard string manipulation would apply. If you split the data correctly (ie at a word or some non-AlphaNumeric character) you could still do 'like's and such...

Corey

Secret Service Agent: Mr. President, you're urinating on me.
President Lyndon Johnson: I know I am. It's my prerogative.
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-05-24 : 17:26:00
Corey, so you're creating multiple rows and keeping some sort of sequence counter in order to re-assemble them at a future date? Because you can't have multiple varchar(8000) fields in one table and fill them up. You'd pop the row size limit. Sounds like more trouble that it's worth.

---------------------------
EmeraldCityDomains.com
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-05-24 : 21:08:41
I did this one time, and its really not a big deal... In fact, one time I got real creative and stored 20 words on a record, 1 word per column. Made it great to count the number of occurances of a word...

Corey

Secret Service Agent: Mr. President, you're urinating on me.
President Lyndon Johnson: I know I am. It's my prerogative.
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-05-25 : 03:12:41
I have to use text I'm afraid, this isn't my design and I am very reluctant to change it as it will probably break the contract with the supplier (though I'm not convinced that's a bad thing)

steve

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

- Advertisement -