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 2005 Forums
 SSIS and Import/Export (2005)
 text with linebreaks cause trouble

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-09-15 : 01:47:53
Hi

I try to export data from a view but have some issues, there is one column that contains text that includes linebreaks and when I export that field to a excel file the text does not come in one cell, instead it is split to as many cells that there are linebreaks, how can I avoid that so that all text come in one cell?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-15 : 01:48:33
Replace the CHR(10) and CHR(13) data with a blank.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 01:52:27
quote:
Originally posted by magmo

Hi

I try to export data from a view but have some issues, there is one column that contains text that includes linebreaks and when I export that field to a excel file the text does not come in one cell, instead it is split to as many cells that there are linebreaks, how can I avoid that so that all text come in one cell?


what is the datatype of the column?
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-09-15 : 06:51:34
it's nText
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 07:07:26
quote:
Originally posted by magmo

it's nText


Then i think you need to use method below as REPLACE wont work with text datatype.

http://www.sqlservercentral.com/articles/Miscellaneous/handlingthetextdatatype/985/
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-09-15 : 07:15:57
Sorry, I have to register to read that article..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-15 : 12:49:48
quote:
Originally posted by magmo

Sorry, I have to register to read that article..


its free. plaese register
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-10-08 : 02:37:38
Ahh, I was a little to quick there... Thanks!
Go to Top of Page
   

- Advertisement -