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)
 Joining two text fields into one field

Author  Topic 

jco510811
Starting Member

9 Posts

Posted - 2007-02-08 : 11:03:20
Hi,

I was wondering if anyone can help?

I have two fields in my table which are text types. The max len of the info in the fields is around 250.

However when i try to add the fields together to make one field, part of the text in the second text box is dropped.

Any ideas on how to merge them?

Code i am using is as follows:

select
Id
, Fun
, Probs
, convert(varchar (8000),RTrim(Ltrim(IsNull(Convert(varchar(8000),(Fun)),''))) + RTrim(Ltrim(IsNull(Convert(varchar(8000),(Probs)),''))) )
from
table


Thanks in advance for your help

jco51081 :-)

nr
SQLTeam MVY

12543 Posts

Posted - 2007-02-08 : 15:02:45
Are you sure it's being dropped rather than just not displaying?
Check the len of the result and also what the max character result length is in management studio.

==========================================
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

jco510811
Starting Member

9 Posts

Posted - 2007-02-09 : 04:27:33
Hi Thanks for your reply, the length is correct 400 when add them together however i cannot get the text to display. I have tried to insert it into a table but it only inserts around 240 characters?

Any idea how to get round this?

How do you check the length in the management studio?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-09 : 04:48:52
As nr said, Query Analyzer has this limitation of 255 chars when displaying column values.
Goto TOOLS -> OPTIONS and change this value to larger (500) if unsure.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -