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
 General SQL Server Forums
 New to SQL Server Programming
 How to remove line break from the column

Author  Topic 

feejaz
Yak Posting Veteran

68 Posts

Posted - 2009-06-23 : 02:53:37
Hi everyone,

I have table with multipal coulmns, one of the column name is address. Inwhich I have saved the record with line break (using Enter key). It shows the record in the table like box. So, I want to remove all the Line break symbols through query. Please help me out, how can I remove the record from the table column.

regards,

feejaz

Navi

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-23 : 03:34:00
REPLACE(REPLACE(REPLACE(Col1, CHAR(13), ' '), CHAR(10), ' '), ' ', ' ')


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

feejaz
Yak Posting Veteran

68 Posts

Posted - 2009-06-23 : 05:54:22
Thanx for reply,

would you please let me know how to execute this query. My table name is "Address" and column name is "StreetAddress"

I tried to execute the query like
update address
REPLACE(REPLACE(REPLACE(StreetAddress, CHAR(13), ' '), CHAR(10), ' '), ' ', ' ')
and found error like "Incorrect syntax near 'REPLACE'."

awaiting your help.

thanx


feejaz

Navi
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-23 : 06:50:41
See Books Online for the correct syntax of UPDATE!
UPDATE  Table1
SET Col1 = ''



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -