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)
 Eliminate empty lines from the string

Author  Topic 

veparala
Starting Member

30 Posts

Posted - 2007-04-12 : 14:24:39
Hi
My character data coming from the database column is like this below exmple.

"Since joining our department, Sondra has been enthusiastic and helpful in every way possible, including pitching in and doing extra PO filing in addition to learning her job.

Thank you Sondra! "


I want to eliminate empty line in between the multiple lines. I need the above paragraph like below.

"Since joining our department, Sondra has been enthusiastic and helpful in every way possible, including pitching in and doing extra PO filing in addition to learning her job. Thank you Sondra! "


Is there any user defined function for this task?. Anybody help me?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-12 : 14:43:05
select col1, replace(col1, char(13) + char(10) + char(13) + char(10), char(13) + char(10))
from table1


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-04-12 : 14:45:10
REPLACE(Col1,CHAR(13)+CHAR(10),' ')?????



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

veparala
Starting Member

30 Posts

Posted - 2007-04-12 : 15:01:35
Can you explain me in detail as i am not understanding this
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-12 : 15:22:44
What we are trying to tell you, is that a newline/enter in a text is composited with a CrLF notation (Carriage Return, Line Feed).
CR has the character value of 13 and Line Feed the value of 10.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -