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
 SQL Server Development (2000)
 Concatenation

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-15 : 08:56:48
Steve writes "SQL experts,

I am trying to concatenate five VARCHAR(255) columns into one TEXT data type column.

How may I combine these columns? Concatenate does not seem to work with TEXT and the VARCHAR data type is not large enough to hold the results.

Thanks."

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2002-01-15 : 09:06:01
I'm not sure how you came under the impression concerning the limitation of varchar. You can decalare varchar columns with a lenght of up to 8000.

Justin

Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2002-01-15 : 09:10:37
Let's say you had a table called InsertTable with a field called text field, you could do something like this

Insert into Inserttable(textfield)
select field1 + field2 + field3 + field4
from othertable
--where clause can go here if necessary



Mike
"A program is a device used to convert data into error messages."
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-01-15 : 09:17:58
quote:
I'm not sure how you came under the impression concerning the limitation of varchar. You can decalare varchar columns with a lenght of up to 8000.


...unless you're using v6.5, that maxes out at 255.

Go to Top of Page

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2002-01-15 : 09:19:37
quote:

...unless you're using v6.5, that maxes out at 255.



Whoops, that was before my time. Thanks Rob

Justin

Go to Top of Page
   

- Advertisement -