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
 Transact-SQL (2000)
 Update HEX value in a varchar column

Author  Topic 

EugeneE
Starting Member

2 Posts

Posted - 2004-07-23 : 15:56:50
Hi All,

Could somebode help me please?
I have a column Comments which collects some data entered on web page into a textarea input field. If user hit ENTER, there is CRLF in this column. It there any way to replace those characters by spaces using Transact SQL only, without additiional programming? Greatly appreciate any help. Eugene

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-23 : 16:04:14
Use REPLACE with CHAR(13) and CHAR(10)

UPDATE Table1
SET Comments = REPLACE(REPLACE(Comments, CHAR(13), ''), CHAR(10), '')

Use at your own risk as I did not test it.

Tara
Go to Top of Page

EugeneE
Starting Member

2 Posts

Posted - 2004-07-23 : 16:16:42
Thank you so much. Works Like a charm. Eugene
Go to Top of Page
   

- Advertisement -