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)
 breaking lines

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-21 : 05:34:43
i have a table with col1,col2,col3....
and i want to put the, all in 1 col like this
col1+col2+col3+....
but between each call i want to put a char of line break so when this data will be in a text area it will be seen with each col in a new line (as if this text was from begining types in a textarea and saved to the DB with the break line char
thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-21 : 05:37:32
Is this what you want ?

if your col is not a varchar, convert it to varchar
select col1 + col2 + col3 + convert(varchar(10), col4) + char(13)
from table




KH

Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-21 : 05:47:10
i meat between each col i want a line break you meant something like :
col1+char(10)+char(13)+col2+char(10)+char(13)+col3+.....

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-21 : 06:11:33
Where do you want to show data?
If you use front end application, do it there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-21 : 15:12:00
ok this is the correct answer
col1+char(13)+col2+char(13)+col3+.....

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-06-21 : 15:15:55
quote:
Originally posted by pelegk2

ok this is the correct answer
col1+char(13)+col2+char(13)+col3+.....

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)



It's the correct answer only if you are viewing the data in Query Analyzer or some other query tool. If you are viewing the data via your application, then that is not the correct answer even if it produces the correct results.

Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -